- Open order on last tick/end of bar?
- How do you test if the pair is in a medium/long term trend?
- How to draw rectangles on top of the chart?
Yes, the last bar is bar 0 . . or perhaps you meant the first bar ?
Yes I meant the first bar.
Bars gives you the . . . "Number of bars in the current chart." but that isn't always going to be the same as the number of bars in the hst file, for example if you set Max bars in chart to 100 then you would only get 100 bars on the chart.
You could try an iBarShift() with a datetime of 0, but I'm not sure if this uses all the history in the hst file or just the history on your chart. Write a little test script and try it . . .
So from the code below its not where the chart history starts from? (edit remembering that arrays start from zero it has to be Bars -1)
int init() { Comment("chart starts from ", TimeToStr(Time[Bars-1])) ; }
So from the code below its not where the chart history starts from? (edit remembering that arrays start from zero it has to be Bars -1)
Bars gives you the . . . "Number of bars in the current chart." but that isn't always going to be the same as the number of bars in the hst file, for example if you set Max bars in chart to 100 then you would only get 100 bars on the chart.
You could try an iBarShift() with a datetime of 0, but I'm not sure if this uses all the history in the hst file or just the history on your chart. Write a little test script and try it . . .
It worked with iBarShift() with datetime of 0 and exact = false, thanks ;)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use