This opens a position on Tuesday:
if (bars.DateTimes[index].DayOfWeek < bars.DateTimes[index-1].DayOfWeek)
How to open a position on Monday?
if (bars.DateTimes[index].DayOfWeek < bars.DateTimes[index-1].DayOfWeek)
How to open a position on Monday?
Rename
For example:
Which means that no trading days remain in this week (hence scale is Weekly - despite that the code should run on Daily)
If Monday is a holiday the position would be opened on Tuesday.
CODE:
if(bars.TradingDaysRemaining(idx,HistoryScales.Weekly) == 0 )
Which means that no trading days remain in this week (hence scale is Weekly - despite that the code should run on Daily)
If Monday is a holiday the position would be opened on Tuesday.
Another example - now this will skip a trade until next chance if Monday falls on a holiday:
CODE:
if(bars.GetNextTradingDate(idx).Date.DayOfWeek == DayOfWeek.Monday)
OK. Thank.
Your Response
Post
Edit Post
Login is required