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

Holidays and Data Compression



PureBytes Links

Trading Reference Links

I'm trying to write information to a file when I get a signal from a weekly
system at the close of the week.  Easylanguage doesn't know that a trade has
occured until the next bar, so I sense the conditions and use those to
determine when to write to file.

The problem comes when there is a holiday.  TS knows to exit properly, say
on Thursday, when there is a holiday on Friday.  But I haven't been able to
figure out how to sense the holiday in my own code so I can write out such
information as the date of the trade on the actual day of the trade.

I've tried:
If DataCompression = 3 and dayofweek(date) = 4
   then Offset = 1;
tradedate = numtostr(juliantodate(datetojulian(date)- 	Offset),0);

This doesn't work because TS apparently thinks the day of the trade is
Friday, even though Friday is a holiday and the actual exit is on Thursday.

If there was a function to determine that today was a holiday, I think the
following might work:
If DataCompression = 3 and "holiday(date) = true"
   then Offset = 1;

But I can't find any functions that identify the existence of holidays.  Any
ideas on how to solve this problem?

Thanks in advance,
Larry