Download MetaTrader 5

iCustom indicator issue - arrows don't appear

To add comments, please log in or register
Download MetaTrader 5 mobile version and trade from anywhere in the world!
Maka4Tune
26
Maka4Tune 2016.07.19 14:06 

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? 

Marco vd Heijden
Moderator
4686
Marco vd Heijden 2016.07.19 15:35  
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.

Maka4Tune
26
Maka4Tune 2016.07.19 18:25  
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. 
Marco vd Heijden
Moderator
4686
Marco vd Heijden 2016.07.19 18:38  
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.
Vasyl Nosal
2
Vasyl Nosal 2016.07.20 09:38  
Maybe someday MQ will add 

ChartIndicatorAdd

to mql4. For now it is in mql5.

 

But you can use  

ChartApplyTemplate

Maka4Tune
26
Maka4Tune 2016.07.22 17:30  
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. 
To add comments, please log in or register