Different SL and TP calculation
Different SL and TP calculation
12 Jan 2022, 09:47
Dear staff,
I'm not quite sure if I'm mistaking here or simple don't see anything, but I'm experiencing a difference in TP and SL calculation between the cTrader Version of spotware and the cTrader Version thats used by ic markets.
I wrote a bot in the spotware version of ctrader and on calling
ExecuteMarketOrder(TradeType.Buy, SymbolName, "", 100, 100);
I'm opening a position at the current price with SL and TP calculated by SL = CurrentPrice - 100; TP = CurrentPrice + 100;
So far so good. Changing to the ic Markets version calling the same function I end up with SL and TP prices as such:
TP = CurrentPrice + 10;
SL = CurrentPrice - 10
I'm missing a factor 10 here. My first guess the leverage of GER40 in the spotware version is 1:20 and in the Ic markets version is 1:200 which differs by a factor ten. Is this the reason for the difference between the two versions?
To be honest I was actually expecting to set the SL and TP values by ExecuteMarketOrder directly instead of setting pips.
Is there a formula for converting pips to marketvalues taking the current leverage into account?
Many thanks
PanagiotisCharalampous
12 Jan 2022, 10:27
Hi there,
The SL and TP are set in pips. Pip values for the symbol can be different on each broker.
Regarding
Check here and here
This has nothing to do with leverage. You just need to add the SL and TP pips to the entry price.
Best Regards,
Panagiotis
Join us on Telegram and Facebook
@PanagiotisCharalampous