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

RE: Day of Week problem



PureBytes Links

Trading Reference Links

{*******************************************************************
Description	: Is Work Day
Provided By	: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: RefDate(Numeric);

If DayOfWeek(RefDate) = 0 OR DayOfWeek(RefDate) = 6 Then
	IsWorkDay = False
Else 
	IsWorkDay = True; 


-----Original Message-----
From: ianwaugh@xxxxxxxxxxxxxxxxxxx [mailto:ianwaugh@xxxxxxxxxxxxxxxxxxx]
Sent: Thursday, March 15, 2001 3:26 PM
To: VKlinchik@xxxxxxxxxxxxx
Cc: ianwaugh@xxxxxxxxxxxxxxxxxxx
Subject: RE: Day of Week problem


In-Reply-To: <3E599F23BE48D411923F0090276D7FF4B78352@xxxxx>
Hi Vitali,
         Wow! That was quick, thank you! Unfortunately, my version of TS - 
TS4 - doesn't recognise "IsWorkDay" and I can't find any reference to it 
in Ask Mr Easy language or the EL book on the Omega Web site. Is this a 
2000i thing?

Cheers,
Ian

> 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