Replies

mmackay911
30 Oct 2024, 10:38 ( Updated at: 30 Oct 2024, 13:21 )

RE: Setting TP and SL in pips not working as expected

firemyst said: 

The “takeprofit” parameter in the execute market order is in Pips; you're supplying an actual price.

Replace “takeProfit” in the ExecuteMarketOrder with your parameter “TakeProfitPips”. 

OR what you need to do is convert “takeProfit” back to pips as a distance from the current candle close, which seems pointless in this scenario as you have it since TP is measured from the current “close” price when the order is placed. 

Thanks @firemyst, changing to TakeProfitPips worked a treat. Your explanation makes perfect sense. Much appreciated.

I wonder if the ExecuteMarketOrder used to be coded to expect the price, rather than pips, since ChatGPT seems to think that's how it works.


@mmackay911