Kite 3 Plugin for auto trading

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)

I was also testing the same and have the same view as you @Nishantr

I tested it today.

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.

Hi @Nishantr,

While sending the mail, you can send the orderlog as well. Any modifications required will by suggested by the support team.

hi @Krishnendu , I used the feedback tool on the Streak portal. No option there to attach the order log. I’ll send order log by email separately.

What I just saw/observed is that the order log shows an exit signal after expiry (in that chronological order).

@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.

Here is a screenshot of the log:SnapCrab_NoName_2020-7-8_17-30-34_No-00%20(2)

You need to send a mail to [email protected] along with the screenshot.

The team will will you with this.

Already done. I have refered to the discussion here too.

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ā€

Hope this helps everyone out.

3 Likes

Thanks for the excellent explanation @TradeRocket !!

1 Like

Anyone, any update on this please…

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.

1 Like

Hi @beherat,

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.

2 Likes

Thanks. Waiting for this update eagerly. How soon can we expect it?

1 Like

has anyone deployed strategies based on 1 min candle? I just noticed it does not work. Just checking to see if its true for all.

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.

That will be an elegant solution to this requirement @Streak . Eagerly looking forward to it.

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.

Hope this gives more insgihts :slight_smile:

Yes we are on it :slight_smile:

2 Likes

The strategies in 1min trigger immediately as the candle closes. What do you mean by, it does not work?

Got it.