Hi, I'm struggling with the problem that I can not convert future bars to a timestamp; I need this for graphical presentations of trendlines and I want to exclude weekends and hollidays. It's not solved by adding to the current time, x PeriodSeconds(bar period) .
To be more specific: TimeCurrent() + (x bars to the right) = which time ?
I hope the answer is simple. TimeCopy is unfortunately only based on history bars and not future bars.
Thx for your advice !!
I hope the answer is simple.
Thx for your reply guys;
What I would like to do is draw an equidistant channel, but in an harmonic way; for instance I have a certain reference bar (which forms a top or a bottom) and want to draw an harmonic numbers of bars to the right, my channel. There I want to stop my channel; when there's a weekend in between (so I can not use "TimeCurrent()+PeriodSeconds()*(x bars to the right)"), I have a problem; In order to avoid messing up my screen, I don't want to use the 'ray' option;
Simply when you use TimeCurent()+PeriodSeconds*BarsCount X as you set the resulting time as the ending point for your trend line or channel you get 2 options
A- when the future time hasn't come yet then there is no problem because there is no bar with this time formed yet so the Line will be plot normally at the time you specified to the right of the Chart
B- if the time that resulted from this equation doesn't exist " there is no bar with this time" due to weekend or what ever reason but however there is bar with a time that is beyond the resulting time then instead of using time use the number of bars required for instance if the number of bars you wnt to add is 10 then you just need to check subtract the index of the beginning bar from the bars count to get the index of the ending bar say the index of starting bar is 50 then you need to subtract 10 bars from it you got index of 40 . this will make you depend on bars count rather than time which will be more accurate . hope you can understand what I mean . in short use IINDEX instead of TIME
1= Use IBarShift() to determine the index of the first Anchor Point of your Cahnnel or Trend Line
2- Subtract the number of bars from the Starting Index 50-30=20+1=21
3- set the ending time as Time[Ending Index]
4- problem solved :)
Thx Mohamed, good advice ! I'll try it out !
A big thank you !!
Thx for your great reply !