Need help with code
Created at 02 Aug 2023, 15:17
DO
Need help with code
02 Aug 2023, 15:17
Hi I want to ask about my code.. I have ctrader version 4.6.7
in this line is still some problem what can I do with it?
TradeType tradeType = TradeType.Buy;
double stopLossPrice = Symbol.Bid - Symbol.PipSize * StopLoss;
double takeProfitPrice = Symbol.Bid + Symbol.PipSize * TakeProfit;
openedPosition = ExecuteMarketOrder(tradeType, Symbol, LotSize, "Long Position", null, stopLossPrice, takeProfitPrice);
PanagiotisChar
03 Aug 2023, 05:37
Hi there,
Not sure what problem you are referring to but your stop loss and take profit are wrong. You need to pass stop loss and take profit in pips, not in actual price.
Aieden Technologies
Need help? Join us on Telegram
@PanagiotisChar