[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Day of Week problem



PureBytes Links

Trading Reference Links

Can anyone help with some DayofWeek code?

I'd like to buy at open and sell at the close of a certain day of the 
week. So, using Monday as an example, I write this:

If DayofWeek(Date)=1 then buy at open;
exitlong at close;

However, Easy Language only allows market orders to be placed for the 
*next* bar. The obvious way around this is to write:

If DayofWeek(Date)=5 then buy next bar at open;

However, the "next bar" could be a Tuesday or even a Wednesday.

Is there any way around this, to specify a buy at open and a sell at the 
close of a specified day?

Cheers,
Ian