I am testing this today. but, i think it should be n=72 instead of n=71.
What we are checking is completion of the candle that opens at 3:10am and closes at 3:15pm,right? Since Square-off time now is 3:20pm.
This would be the 72nd 5-min candle of the day.
So, at 3:15pm candle open (3:15pm candle would be the 73rd 5min candle) if we have to exit, then the 3:10pm candle (n=72) formation must be complete (Close >0)
But, @streak didnāt generate any exit trigger notification for that condition (Nth Candle(close, 5 min, 72) higher than 0.0). I will write to Streak support and check on this.
@Krishnendu , I have sent the logs to the support.
What I observe is that the exit signal doesnāt get sent on the opening of the 73rd 5-minute candle (the candle with open at 3:15 pm) even if the exit signal says 72nd 5 minute-candle close is higher than 0.
The order log shows that in chronology the strategy expired at 3:20 pm and the exit buy/sell signal notification was generated after that.
Effectively, the exit signal was generated after close of 73rd 5-minute candle and at the open of 74th 5-minute candle.
I tired this, for 5min candle what i found to work as an exit condition was : Nth candle(Close,5min,71) higher than 0.0.
The reason why so, i came across one of the earlier tickets I had raised. Nth Candle along with Opening range, indicators on Streak, give valid levels on for the next candle once the opening range/nth candles are completely formed.
So by that logic, 71st 5min candle is 3:05pmās candle, which closes at 3:10, now the Nth candle level has been established(prior to this it was null). Now on the immediate next candle i.e 3:10pm candle, the condition will be valid once the candle closes, which is at 3:15pm, this observed in the backtest too, the exit happens for 3:10 pm candle, at the opening price of 3:15pm candle.
This is have been told has been done to avoid look-ahead bias in backtests.
Summary: For 3:15 pm(73rd 5min candle) exit, as the signals are generated once the candle is close, trigger should be generated at the close of 3:10pm(72nd 5min candle), and for this trigger to happen based on Nth Candle indicators, the Nth candle value should be established on candle before i.e 71st candle.
So to get exit triggers at sharp 3:15pm what works for me has been āNth candle(Close,5min,71) higher than 0.0ā
Thank Navin. For sharing what you found out. Will check it today.
I find this somewhat of an anamoly on Streak. When a recent candle closes, Streak is able to tell if the candle has crossed an indicator, or if the candle has crossed an opening range, if it is higher than any price point/indicator, and so gives us entry/exit trigger at the open of the immediate candle. But, if you refer to the recent closed candle as ānth candleā, streak isnāt able to confirm its formation by checking if itās close price is greater than zero. To be able to get that checked, we have to wait for formation of n+1st candle. Strange.
Nth candle based exit for Renko is especially difficult as Renko might/might not form at for the time you are looking for, making the aproach being discussed is highly unreliable for timing the exit for Renko charts.
For timing exits we are implementing another parameter in advanced called exit by time, should be available in the upcoming releases.
I think 1 min candles should better be used on live terminals keeping a close watch on the movement. I had tried it in backtesting for few stocks and indices. Not much success in that.
Hi @Nishantr,
This is by design and true to both Nth candle and opening range, let us try to explain with a couple of examples and then on why it is done so.
Opening range Ex: for 1min OR(open,1min)=OR(close,1min), say this condition is true, this will trigger at the close of immediate next candle i.e at the close 9:16am candle, which is at 9:17am and not at the close of 9:15am candle, which is at 9:16.
Because all the conditions are established and validated only at the close of the candle this time shift I observed.
Also Both OR and Nth Candle indicators were designed to be fix a level and then to check those levels with some other value like Close,SMA, etc.
In that scenario say Ex: for 1min Close crosses above OR(open,1min), and say the 9:16am candle meet the criteria, the signal will get generated at the close of this at 9:17 am, which is perfectly correct result.
The same logic applies to Nth candle as-well.
Now why this is done like this, is because the OR/Nth candle levels are supposed to established only for the subsequent candles, to avoid any look ahead biases and generation of signals at a time in backtest which would not be generated at the same in live scenarios for some special combinations.