iCustom indicator issue - arrows don't appear

 

Hi there,

I'm a programmer but new to MQL5. I've created an indicator that uses %R to determine buy or sell based on over-bought or over-sold stock. When I drag the indicator onto the chart I get DOWN_ARROW and UP_ARROW indicators fine. I wrote an EA to automate opening and closing positions based on that indicator using iCustom however no arrows appear on the chart. Do I need to duplicate the indicator plotting code in the EA to draw the up and down arrows when the EA discovers a BUY or SELL in the buffers? 

 
Maka4Tune:

Hi there,

I'm a programmer but new to MQL5. I've created an indicator that uses %R to determine buy or sell based on over-bought or over-sold stock. When I drag the indicator onto the chart I get DOWN_ARROW and UP_ARROW indicators fine. I wrote an EA to automate opening and closing positions based on that indicator using iCustom however no arrows appear on the chart. Do I need to duplicate the indicator plotting code in the EA to draw the up and down arrows when the EA discovers a BUY or SELL in the buffers? 

Yes simply load the indicator on the chart and read it by iCustom.

Reading by iCustum does not plot on the chart so you either have to have the EA plot the arrows or load the indicator onto the chart.

It defies purpose because if you run a robot to trade its usually because you do not want to look at the screen, and if you load an indicator it is usually because you do want to look at the screen.

So if you load the indicator and also run the robot i can only assume its some sort of hybrid or semi automatic type of strategy that you still want to keep an eye on.

 
Thank you for the response, that makes complete sense. What's strange is that when I right click the EA and test it, the arrows from the indicator appear but when dragged onto a Live chart they don't. Is there a reason why? I have created a hybrid for now to check that the trades are occuring correctly when the indicator triggers a buy or sell. At the moment the indicator in the test it showing but not always firing the trade. Really strange. 
 
Maka4Tune:
Thank you for the response, that makes complete sense. What's strange is that when I right click the EA and test it, the arrows from the indicator appear but when dragged onto a Live chart they don't. Is there a reason why? I have created a hybrid for now to check that the trades are occuring correctly when the indicator triggers a buy or sell. At the moment the indicator in the test it showing but not always firing the trade. Really strange. 
Well the option might be to convert the entire thing into a fully functional EA.
 
Maybe someday MQ will add 

ChartIndicatorAdd

to mql4. For now it is in mql5.

 

But you can use  

ChartApplyTemplate

 
I found the problem, firstly I writing into the zero bar of the buffer for some strange reason but also I didn't have the PLOT_ARROW_SHIFT set and they were all flying to the top of the screen. I did say I was new to this. We live and learn :-) Thank you for the responses. 
Reason: