Take Profit fails to be triggered
Take Profit fails to be triggered
02 Mar 2020, 19:41
Dear Team,
We are running on your cTrader Demo platform. We have developed a cAlgo trading robot, but the take profits occasionally fail to trigger. Please see the chart screenshot attached.
The order was set as a limit resting order:
Entry Price = 1.12760 (resting price 1.12726) Order was filled above.
Take Profit = 1.12621
Account size = 750KUSD and Leverage is 10x. The market moved down to 1.1235 (approx), but no take profit was triggered. Can you kindly take a look?
This is a persistent problem and there are many other examples of trades failing to execute, which makes optimising very difficult.
Kind regards,
Replies
ctid1412177
03 Mar 2020, 11:04
( Updated at: 21 Dec 2023, 09:21 )
RE:
PanagiotisCharalampous said:
Hi ctid1412177,
If this happens and can be reproduced on backtesting, please provide the cBot code, cBot parameters and backtesting settings so that we can reproduce the problem and let you know what happens. If this happened on live execution, please contact your broker.
Best Regards,
Panagiotis
Thanks, Panogotis,
This can be reproduced consistently in backtesting. The account is Spotware and we are not dependant on a broker. The strategy relies on multiple inputs, some of which are entirely proprietary and can not be disclosed unless you are prepared to sign an NDA?
//Our order send is:
private void sendLimitOrder(TradeType tType, bool isBuyer, string comment, string label, double entryPrice, double takeProfitPrice, double stopLossPrice)
{
positionCheck();
if (canTrade == true)
{
var result = PlaceLimitOrder(tType, SymbolName, getVolume(), entryPrice, label, getStopLoss(isBuyer, entryPrice, stopLossPrice), getTakeProfit(isBuyer, entryPrice, takeProfitPrice), null, comment, false);
if (result.IsSuccessful == true)
{
var position = result.PendingOrder;
Print("Position entry price is {0}", position.TargetPrice);
}
}
}
//Stop Loss
private double getStopLoss(bool isBuyer, double price, double stopLossPrice)
{
double pips = 0.0;
if (isBuyer == true)
{
pips = Math.Floor(Math.Round(price - stopLossPrice, Symbol.Digits) * 10000);
}
else
{
pips = Math.Floor(Math.Round(stopLossPrice - price, Symbol.Digits) * 10000);
}
return pips;
}
//Take Profit
private double getTakeProfit(bool isBuyer, double price, double takeProfitPrice)
{
double pips = 0.0;
if (isBuyer == true)
{
pips = Math.Floor(Math.Round(takeProfitPrice - price, Symbol.Digits) * 10000);
}
else
{
pips = Math.Floor(Math.Round(price - takeProfitPrice, Symbol.Digits) * 10000);
}
return pips;
}
The chart clearly shows a low well in excess of the TP level.
A similar situation where the short was added. Take profit failed to execute, but a new sell order was triggered and the take profit on that order was executed at a much lower price action.
Kind regards,
@ctid1412177
PanagiotisCharalampous
03 Mar 2020, 11:07
Hi ctid1412177,
We need a fully working cBot that will allow us to reproduce the behavior on backtesting. Else we cannot know what is causing this behavior.
Best Regards,
Panagiotis
@PanagiotisCharalampous
ctid1412177
03 Mar 2020, 11:27
RE:
PanagiotisCharalampous said:
Hi ctid1412177,
We need a fully working cBot that will allow us to reproduce the behavior on backtesting. Else we cannot know what is causing this behavior.
Best Regards,
Panagiotis
Send me your NDA? Can you tell me your email address?
@ctid1412177
PanagiotisCharalampous
03 Mar 2020, 11:32
Hi ctid1412177,
We do not see a reason to sign an NDA at the moment. You claim that there is an issue with cTrader not triggering a TP. You need to provide some code that supports this claim.
Best Regards,
Panagiotis
@PanagiotisCharalampous
ctid1412177
03 Mar 2020, 11:34
RE:
PanagiotisCharalampous said:
Hi ctid1412177,
We do not see a reason to sign an NDA at the moment. You claim that there is an issue with cTrader not triggering a TP. You need to provide some code that supports this claim.
Best Regards,
Panagiotis
What is your email address?
@ctid1412177
PanagiotisCharalampous
03 Mar 2020, 11:35
Hi ctid1412177,
community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous
ctid1412177
03 Mar 2020, 11:51
RE:
PanagiotisCharalampous said:
Hi ctid1412177,
community@spotware.com.
Best Regards,
Panagiotis
sent
@ctid1412177
PanagiotisCharalampous
03 Mar 2020, 10:02
Hi ctid1412177,
If this happens and can be reproduced on backtesting, please provide the cBot code, cBot parameters and backtesting settings so that we can reproduce the problem and let you know what happens. If this happened on live execution, please contact your broker.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous