I am trying to see how I can perform the following:

Let's assume; I want to use SMA(10/SMA(50) indicator to enter and exit positions. Now I want to perform automated trading of this strategy with live data. There are two ways, I can run this in live trading:

1 - Run the strategy everyday once at 3:59PM ET, and perform the trade.

2 - Run the strategy every minute throughout the day. At each minute calculate the SMA(N) using close price of previous N-1 days and the latest price at the moment for this day.

The 2nd strategy allows the algorithm to react to potential major swings throughput the day. Can the second strategy be implemented in backtrader, how?

Thank you very much.

]]>I am trying to see how I can perform the following:

Let's assume; I want to use SMA(10/SMA(50) indicator to enter and exit positions. Now I want to perform automated trading of this strategy with live data. There are two ways, I can run this in live trading:

1 - Run the strategy everyday once at 3:59PM ET, and perform the trade.

2 - Run the strategy every minute throughout the day. At each minute calculate the SMA(N) using close price of previous N-1 days and the latest price at the moment for this day.

The 2nd strategy allows the algorithm to react to potential major swings throughput the day. Can the second strategy be implemented in backtrader, how?

Thank you very much.

]]>The *length* (`len(data_in_use)`

) determines if the replaying has moved to a new day.