pine script close all position at the end of day

Viewed 179

my problem is that I cannot close my open position at the end of a day because I am using the ranko chart pattern. as you know in ranko candle time is not fixed so how can I use IST time in pine script to exit every day at a particular time.

in without Renko chart, i was using this code to exit poison

if (hour==15 and minute==29)
    strategy.close_all("Day Close")
1 Answers

Run your strategy on standard candlestick chart and request renko information from there. Then you can close positions as you normally would do.

Renko example:

//@version=5
indicator('Example 7', overlay=true)
renko_t = ticker.renko(syminfo.tickerid, 'ATR', 10)
renko_low = request.security(renko_t, timeframe.period, low)
plot(renko_low)
Related