Strategy AddOrder during specific times


Category:
0
0

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?

Thanks

Stock.

 

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

This has already been posted in the forum:

https://www.hahn-tech.com/ans/limiting-backtesting-strategy-results-to-specific-times-of-the-day/

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: 4087)
Answered on October 11, 2020 11:21 am
0
Thanks Pete, I will go through the provided solution.
( at October 11, 2020 11:39 am)