Ctrader Algo sometimes missed signal!
Ctrader Algo sometimes missed signal!
05 Nov 2024, 04:16
Hi,
I'm very confusing because what happened today. Please help
My bot logic is if RSI lower than RsiCloseLoss it will close all positions openning, but when RSI go to 14,17 (RsiCloseLoss is 22) it do nothing, double check my code and it seem right. It worked before, but sometimes it doesn't
bool closeLoss = rsi.Result.LastValue < RsiCloseLoss && rsi.Result.Last(1) < RsiCloseLoss;
bool closeProfit = rsi.Result.LastValue > RsiCloseProfit && rsi.Result.Last(1) > RsiCloseProfit;
if (closeLoss || closeProfit){
CloseAllPositions(); //Just normal Close all positions
}
Replies
dkt0591
12 Nov 2024, 09:02
( Updated at: 12 Nov 2024, 11:13 )
RE: Ctrader Algo sometimes missed signal!
PanagiotisCharalampous said:
Hi there,
It seems you are using the current RSI value in your checks, something that can cause false signals since the value can change by the time the candle is finalized. Try this instead
bool closeLoss = rsi.Result.Last(1)< RsiCloseLoss && rsi.Result.Last(2) < RsiCloseLoss; bool closeProfit = rsi.Result.Last(1) > RsiCloseProfit && rsi.Result.Last(2) > RsiCloseProfit;if (closeLoss || closeProfit){ CloseAllPositions(); //Just normal Close all positions}
Thank you
@dkt0591
PanagiotisCharalampous
05 Nov 2024, 12:02
Hi there,
It seems you are using the current RSI value in your checks, something that can cause false signals since the value can change by the time the candle is finalized. Try this instead
@PanagiotisCharalampous