Optuma Forums › Optuma Scripting › Turn of Month Seasonality › Reply To: Turn of Month Seasonality
July 4, 2021 at 10:48 am
#65157
- Topics: 54
- Replies: 77
- Posts: 131
I figured out a trick when I was doing similar research in the tester..
Lets say you want the 26th as your entry date however it might fall on a weekend like Matthew said, which will then skip to the next month.
Instead of it entirely skipping, maybe the following day was a Monday and it can enter then. Here is how to “Buy the next available date”
1 2 3 4 5 6 7 |
//set entry //Buy on the 26th (but if 26th is not a trading day, buy next available date within 5 bars a1 = DAYNUM() >26 and DAYNUM() <31; a2 = NOREPEAT(a1, BARS=5); a2 |
Jeff