-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019.05.06)
Messages Editor -
You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016.05.11) -
Change the style to histogram.
-
In MT4, buffers and the predefined arrays are all ordered AsSeries. There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the MT4 predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.
To determine the indexing direction of time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[], call ArrayGetAsSeries(). In order not to depend on default values, you should unconditionally call the ArraySetAsSeries() function for those arrays, which are expected to work with.predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019.05.06)
Messages Editor -
You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016.05.11) -
Change the style to histogram.
-
In MT4, buffers and the predefined arrays are all ordered AsSeries. There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the MT4 predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.
Thank you very much mate. I have adapted the code to the above edited one and I will try to understand what you've posted. Unfortunately at the moment it is still having the same problem as before where it goes haywire in the recent history and draws lines everywhere. Please help me! Thank you!
Hi I'm sorry but I just don't have the coding knowledge to understand what you're hinting at. Thank you very much for the reply regardless, I really appreciate it. I'll try and work it out. I only want the vertical line to appear on the D1 only, and only if that D1 is an outside bar.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi I am trying to draw a vertical line on every outside bar on the daily timeframe. At the moment I'm very close, but suffering from glitches where it draws the lines everywhere, many not on outside bars.
Please advise. Thank you!