For example if running a strategy looking at the 4h timeframe candle stick. You can have a timer running on an hourly timeframe and look a the 4h timeframe candle stick for the candle which hasn't yet closed and do your calculations there.
One drawdown from making calculations before the candle stick is close is that the trend may change and produce a different outcome by the time the candle is closed.
It may give you early signals but it may also give false signals. Pick your poison.
Im trying to convert pine script to python. I use security function for requesting data in pine script. Can someone help me how the exact implementation would be ?
security(tickerid, timeframe, close, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)
Also im using lookahead_on (this is basically used for backword compatibility for pine script version i guess)
I tried to find security function lib code but couldn't find it.
Convert security function in pine script to python