Subplots not showing for any expert advisor

 
I'm having trouble getting subplots to appear for expert advisors. I only have this problem while testing on live data - when backtesting on historical data everything works fine. Is there a setting that disables subplots from showing? I am a relatively new user, so maybe I'm missing something here.
Files:
p1.PNG  122 kb
p2.PNG  146 kb
 
Macintyre Sunde: I'm having trouble getting subplots to appear for expert advisors. I only have this problem while testing on live data - when backtesting on historical data everything works fine. Is there a setting that disables subplots from showing? I am a relatively new user, so maybe I'm missing something here.

That is totally normal. Indicators used by Expert Advisors are not displayed when live. They appear in the Strategy Tester mainly because it is a testing environment, where one may need the visual aids for debugging.

 

Thanks so much, I had begun to suspect that. Is there a way to draw shapes when live in the EA?

 
Macintyre Sunde # :

Thanks so much, I had begun to suspect that. Is there a way to draw shapes when live in the EA?

If you add the necessary MQL5 code to the Expert Advisor, then you can display the indicators on the chart when working online. You need to explore these features:

ChartID

Returns the ID of the current chart

ChartIndicatorAdd

Adds an indicator with the specified handle into a specified chart window

ChartIndicatorDelete

Removes an indicator with a specified name from the specified chart window

ChartIndicatorGet

Returns the handle of the indicator with the specified short name in the specified chart window

ChartIndicatorName

Returns the short name of the indicator by the number in the indicators list on the specified chart window

ChartIndicatorsTotal

Returns the number of all indicators applied to the specified chart window.

Documentation on MQL5: Chart Operations / ChartID
Documentation on MQL5: Chart Operations / ChartID
  • www.mql5.com
ChartID - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Macintyre Sunde #: Thanks so much, I had begun to suspect that. Is there a way to draw shapes when live in the EA?

Yes, you can add Graphical Objects to your chart: Documentation on MQL5: Object Functions

Documentation on MQL5: Object Functions
Documentation on MQL5: Object Functions
  • www.mql5.com
Object Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: