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

Plotting a future calendar day from an existing date



PureBytes Links

Trading Reference Links

Using 2000i I am trying to place a dot a certain number of calendar
days in the future from a given date.  There are enough "bars to the
right" available in "Format Window", "Properties" to allow for the
display of the Plot.

If the bar already exists then the following DOES work:

Inputs: SLowDate("05/24/2000"),NxtDay(28);
 
[Match the Swinglow Date Julian date to a bar and store it's value}
If ELDatetoString(date)=SlowDate then begin
Value1=DatetoJulian(date);

{show the entered date}
Plot1(high,"Slowdate")
end;

{show a dot NxtDay(s) from the entered date}
If DatetoJulian(date)=Value1+NxtDay then
Plot2(high,"NxtDay")

BUT if the bar hasn't happened yet, this can't compare the future date
to the bar.  Since the [-n] doesn't account for Saturdays and Sundays
I tried to get it to tell me what bar number a Future Julian date
would be.

So I tried the following in order to compare a FUTURE date to the
Calendar date, but it won't verify because "Cannot implicitly convert
numerical to True/False" when it encounters "If BarNumber....."


	If  BarNumber[-20](date)=Juliantodate(Value1+NxtDay)
	Plot2[-20] (high, "NxtDay");

If this were to work I could increment the BarNumber until the
conditional became true. The only other thing I can think of is to
keep track of how many Saturday's and Sundays there are between the
Calendar dates by using the "DaysOfWeekFix", and subtract them from
the future date to get the correct future bar date, but that would be
a mess.  Plus I am not sure DaysOfWeekFix would work for bars that
haven't occurred yet.

Any Ideas?

Thanks, Fred



"Success is the only test of genius" -R.Adm Daniel Gallery 1901-1977