I made a simple moving average crossover strategy that I just realized isn't accurate on my backtest. I have a condition that the daily low must be over yesterdays low for the long, and the daily high must be under yesterdays high for the short. For the current day's low, I simply used "low(period=aggregationPeriod.DAY)" but found out today after Powell's pump and dump (and pump) it entered a trade in real time, but when we took out yesterday's low of day the trade it no longer met the conditions, since for the backtesting its looking at the entire day, not the low at the time of condition.
Long story short, Im not the best at coding and ChatGpt isnt giving me anything that's working, how can I code a variable that captures the lowest price of the day at any given point? I assume I have to do something with time and reset it everyday so it can be used in a backtest.
Long story short, Im not the best at coding and ChatGpt isnt giving me anything that's working, how can I code a variable that captures the lowest price of the day at any given point? I assume I have to do something with time and reset it everyday so it can be used in a backtest.