I want to try to count wave patterns in my EA and see the wave counts on the chart. Do I need to create a custom indicator and attach that indicator to the template file and access the custom indicator in the EA or can I call a function to draw an object on the charts directly from the EA?
I have just started researching how to use PlotIndexSet... functions work but all the code samples I have seen use the OnCalculate function. Which as far as I can tell, OnCalculate is only for custom indicators and not for EAs.
From documentation :
These functions can't be used when writing Expert Advisors and Scripts.
So you have either to create Objects directly in your EA or use a Custom indicator.
From documentation :
So you have either to create Objects directly in your EA or use a Custom indicator.
ObjectCreate(0,"prevHigh",OBJ_ARROW_SELL,0,TimeCurrent(),1.453);I added that line to my EA and I do not see the arrows on the chart
I added that line to my EA and I do not see the arrows on the chart
Was the value 1.453 on your chart at the time ? try placing the arrow at Bid or Ask price instead, that is guaranteed to be visible on your chart.
ObjectCreate(0,"prevHigh",OBJ_ARROW_SELL,0,TimeCurrent(),m_symbol.Bid());still nothing
I added that line to my EA and I do not see the arrows on the chart
still nothing
Maybe you need to explicitly give it a colour ?
ObjectCreate(0,"prevHigh",OBJ_ARROW_SELL,0,TimeCurrent(),m_symbol.Bid()); ObjectSetInteger(0, "prevHigh", OBJPROP_COLOR, Yellow);
Maybe not Optimization but aren't they plotted during visual mode ? I hope they are . . . but haven't tried. They are from an Indicator.
RTFM ;-)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to try to count wave patterns in my EA and see the wave counts on the chart. Do I need to create a custom indicator and attach that indicator to the template file and access the custom indicator in the EA or can I call a function to draw an object on the charts directly from the EA?
I have just started researching how to use PlotIndexSet... functions work but all the code samples I have seen use the OnCalculate function. Which as far as I can tell, OnCalculate is only for custom indicators and not for EAs.