PureBytes Links
Trading Reference Links
|
w> I am still looking for a solution how to convert lets say 12 bars in the
w> future to the relevant date. In daily chart I need to take care of weekends
w> and holidays. Any ideas?
Well, making that number 15 into a variable is the first thing, but
then you'll need to check the future dates whether there are any
weekends/holidays in that future period. Solving this for Saturdays
and Sundays is easy, but when you also want to take into account
holidays it will be a *MAJOR* headache - there is no way for TS to
know future holidays in advance unless you create your own holiday
database etc. I tried it once and failed :(, then found a workaround
so I would not need it.
Think about it: for computational purposes, only thing you need is the
numbers of bars. For plotting, you need also dates. If you just want
to plot/place text into the future x bars after LastBarOnChart, all
you need is to specify the number of bars in the future and use the
method below because TS assumes that there are no holidays during this
future period before they are actually known (it is aware about the
weekends).
Ivo Karindi
w> vars: y(0), Str(""), DD(0);
w> if LastBarOnChart then begin
w> Str = "YourString";
w> DD = JulianToDate(DateToJulian(Date) + 15);
w> y = Text_New(DD1, 0, Low, Str);
w> Text_SetStyle(y, 0, 1);
w> end;
|