Hi All,
I want to find out what happens on a particular day. Eg: are Monday's up or down?
Normally I would write a system
If DOW(today) = Friday then buy next bar on open.
Exitlong MOC
The problem is if Monday is a holiday then the results would include some Tuesday data.
I want to create a system where....
If lastbaronchart = false then begin {so I don't produce an error on the last bar}
If DOW(tomorrow) = monday then buy tomorrow's open
Exitlong @ tomorrow's close
How would I code this up?
Regards,
Paul
Get tomorrow's open
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
DayOfWeek will give you the "Monday" information.
not sure about the "tomorrow" part.
since this is a backtest, you don't have to worry about lastbaronchart.
you can try this: (pseudo code)
not sure about the "tomorrow" part.
since this is a backtest, you don't have to worry about lastbaronchart.
you can try this: (pseudo code)
Code: Select all
If DOW(yesterday) = monday then buy today at market
Exitlong @ MOC
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times