Strategy AddOrder during specific times


Hi Pete,

Thanks for your responses for all the questions.

I am looking to have the AddOrder during the first hour and also the last hour of the regular market hours.

In other words, I would like to backtest my strategy during certain periods of the market only.

For either a Buy or Sell, the position should be closed on or before the regular market closing time.

Can these conditions be included in some way in the AddOrder logic?




Marked as spam
Posted by (Questions: 6, Answers: 3)
Asked on October 11, 2020 10:43 am
Private answer

This has already been posted in the forum:

The solution requires you modify your code using a solution I provided for a scan. But the logic is exactly the same whether you apply it to a scan or a strategy.

There is no way to do this through user settings. Your code must be modified.

Marked as spam
Posted by (Questions: 37, Answers: 3988)
Answered on October 11, 2020 11:21 am
Thanks Pete, I will go through the provided solution.
( at October 11, 2020 11:39 am)