Accessing system time in Trade script

Hi
I am new to trade script.
I basically want to create a script, that gives an alert.
Candle Time Period = 15 min
Condition:

Part 1) After 1st candle formed, give alert, if the next 3 candles are within the limits of High and Low of the 1st candle. Which means upto 10:16 am.

Part 2) Once, above condition satisfies, give alert, as soon as the 1st candle’s high or low is brocken.

Need help in this regard.
Thanks

1 Like

There is no time component in trade script.

Use hourly chart and code as below.

LAST > REF(HIGH,1) OR LAST < REF (LOW, 1).

this opening range break out can be programmed easily by using kite Connect API. You can do anything with API. You can compare previous day high and low also.

Thanks for your reply.

In the code you mentioned, LAST is the latest 1 hr candle, and Ref (HIGH,1), and REF(LOW,1) are 1st one hour candle of the day, if I am not mistaken. Please confirm the same. Regards

LAST is LTP.

REF (HIGH, 1) means previous candle high.

:ok_hand: Thanks Mr. Hari