I am calling the TRIX indicator in an EA to calculate some values. The moving period can vary so I am calling it within a function and not within the OnInit() function. The issue I am having is every time the moving period changes, it adds a new indicator to the chart. Is there a way to either delete the old indicator or not display it at all. Here is the code I am using to call the indicator:
- Web version features
- Technical analysis tools in MetaTrader 5
- MQL5 Wizard: Development of trading robots for MetaTrader 5
CappinJack:
I am calling the TRIX indicator in an EA to calculate some values. The moving period can vary so I am calling it within a function and not within the OnInit() function. The issue I am having is every time the moving period changes, it adds a new indicator to the chart. Is there a way to either delete the old indicator or not display it at all. Here is the code I am using to call the indicator:
I am calling the TRIX indicator in an EA to calculate some values. The moving period can vary so I am calling it within a function and not within the OnInit() function. The issue I am having is every time the moving period changes, it adds a new indicator to the chart. Is there a way to either delete the old indicator or not display it at all. Here is the code I am using to call the indicator:
Here is what the chart looks like after running a while
CappinJack:
I am calling the TRIX indicator in an EA to calculate some values. The moving period can vary so I am calling it within a function and not within the OnInit() function. The issue I am having is every time the moving period changes, it adds a new indicator to the chart. Is there a way to either delete the old indicator or not display it at all. Here is the code I am using to call the indicator:
I am calling the TRIX indicator in an EA to calculate some values. The moving period can vary so I am calling it within a function and not within the OnInit() function. The issue I am having is every time the moving period changes, it adds a new indicator to the chart. Is there a way to either delete the old indicator or not display it at all. Here is the code I am using to call the indicator:
When the MA period has change, new handle is created.
If you're using some Chart Operations in your EA, like using ChartIndicatorAdd, then maybe you should not using it or also should use ChartIndicatorDelete

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