Execution issue live and backtest

I am building a strategy where I check the trading signal on the daily timeframe, but I want to execute the order at 3:20 PM, before the market closes at 3:30 PM.

The challenge is:

The daily candle is not fully completed at 3:20 PM, so the final daily indicator value is not yet available.

If I use daily data for backtesting, it introduces look-ahead bias because the daily close is only known at 3:30 PM.

If I instead use intraday timeframe data (like 1-minute) to simulate the execution price at 3:20 PM, the indicator signals on intraday charts may differ from the daily indicator.

So my question is:

👉 What is the correct way to design both the backtest and the live trading logic in this case?

Specifically:

How should I calculate the daily signal so that it reflects the information actually available at 3:20 PM?

Which data should be used for execution price in backtesting?

How do I avoid mismatch between daily signals and intraday data?

Hi @7350982949 ,

We cannot fetch data only upto 3:20pm during backtesting using day candle. Instead you can consider 1-min or 5-min timeframe candles from 9:15 to 3:20pm and resample the data till 3:20pm and use it.