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

RE: Day of Week problem



PureBytes Links

Trading Reference Links

Try 

If DayOfWeek(Date + 1) = 1 And IsWorkDay(Date + 1) Then Buy Next Bar At
Open;


-----Original Message-----
From: ianwaugh@xxxxxxxxxxxxxxxxxxx [mailto:ianwaugh@xxxxxxxxxxxxxxxxxxx]
Sent: Thursday, March 15, 2001 2:50 PM
To: omega-list@xxxxxxxxxx
Cc: ianwaugh@xxxxxxxxxxxxxxxxxxx
Subject: Day of Week problem


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