Hey, can anyone help with an MT4 indicator problem?
I am experiencing some strange anomalies with a custom indicator I have built. After whittling away for several hours I have gotten it down to just a few lines of code and one buffer. The problem seems to be when I reference a Symbol which isn't the main symbol of the chart. EUR/GBP when the chart is USD/GBP for example.
The chart looks fine but when I query the results in my EA they start to pull away from what the graph below is stating. Very odd. I wondered if I didn't have the data downloaded for both symbols but checked and all seems fine. In the strategy tester they start out exactly the same, both reporting 1.23456 but after a few bars in the EA is saying it is getting back 1.22345 and the indicator is saying 1.334455.
I am referencing the closed bar (index 1) and have removed all parameters from the indicator so as to remove any chance of the difference.
I wondered the following:
Has anyone else had success pulling data from multiple symbols in one indicator? (Or experienced problems)
Is it possible to trap errors in Indicators and how can I log or alert for them? EG if a symbol is not returning data.
Many thanks in advance
Rich
I am experiencing some strange anomalies with a custom indicator I have built. After whittling away for several hours I have gotten it down to just a few lines of code and one buffer. The problem seems to be when I reference a Symbol which isn't the main symbol of the chart. EUR/GBP when the chart is USD/GBP for example.
The chart looks fine but when I query the results in my EA they start to pull away from what the graph below is stating. Very odd. I wondered if I didn't have the data downloaded for both symbols but checked and all seems fine. In the strategy tester they start out exactly the same, both reporting 1.23456 but after a few bars in the EA is saying it is getting back 1.22345 and the indicator is saying 1.334455.
I am referencing the closed bar (index 1) and have removed all parameters from the indicator so as to remove any chance of the difference.
I wondered the following:
Has anyone else had success pulling data from multiple symbols in one indicator? (Or experienced problems)
Is it possible to trap errors in Indicators and how can I log or alert for them? EG if a symbol is not returning data.
Many thanks in advance
Rich