
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello, I am currently creating an indicator that shows the high and low of the previous bar for an user inputted time frame. It is currently working in some scenarios, however when the input timeframe or chart timeframe is changed it can start to output incorrect lines or sometimes not even output at all. I am new to MQL5 and am still getting use to the coding style so would appreciate any advice on how to fix my problem or improve my code.
I have attached two images showing correct and incorrect outputs:
Correct: Input is set to 1 day, showing indicator on 5m chart
Incorrect: Line appears to show just the current days high and low for every bar. Input is set to 1 day, showing indicator on 15m chart:
Thank you