Download MetaTrader 5

Get Impulse Direction

To add comments, please log in or register
Carry on your private correspondence in your profile. It is secure!
Leon Lodewyks
288
Leon Lodewyks 2015.12.03 20:54 

Hi

I'm hoping someone might be able to help. I'm using the attached elder impulse indicator and trying to code my EA to check the color of the indicator automatically. Either green, blue or red.

Really struggling with it though.

I think I need to use something similar to the below, and although it is returning a value, it is not correct I don't think as it definitely does not correspond to the color on the 4 hour candle. 

 double GetImpulseDirection4hr()

{

      double val = iCustom(Symbol(),PERIOD_H4,"Impulse Indicator",5000,2,1);

      return val;

}

 

Thanks in advance

Leon 

Files:
Alain Verleyen
Moderator
30739
Alain Verleyen 2015.12.03 21:17  
This function will give you the red value at last closed candle.
Leon Lodewyks
288
Leon Lodewyks 2015.12.03 22:23  
Alain Verleyen:
This function will give you the red value at last closed candle.

Hi Alain

Thanks for the info. Do you know how I can get it to return either red, blue or green depending on what the previous candle was? Is that possible?

Alain Verleyen
Moderator
30739
Alain Verleyen 2015.12.04 11:45  
Leon Lodewyks:

Hi Alain

Thanks for the info. Do you know how I can get it to return either red, blue or green depending on what the previous candle was? Is that possible?

All is possible, you will have to learn coding or ask someone to do it for you.

Your question is unclear.

Leon Lodewyks
288
Leon Lodewyks 2015.12.04 20:50  

Hi Alain

I am actually coding this myself. I am able to code, but I just need some assistance as I am just starting to use MQL.

I will try and rephrase my question, which will hopefully make it more clear: 

The indicator which I have attached, when attached to the chart, will draw either a red, blue or green line under the chart. I want my EA to "call" the indicator to retrieve the color - blue, red or green.

I thought this is done by using the iCustom function, but I can't get this to work, so I was looking for some assistance.

 

Thanks for your help

Leon 

Marco vd Heijden
Moderator
4704
Marco vd Heijden 2015.12.04 23:18  

yes with iCustom but you need to know what it returns can be either a price value or a level value etc. usually not a color, color is usually derived from the level.

just look into the code of the indicator and see if you can find the formula then you can build from that.

Hely Rojas
202
Hely Rojas 2016.01.12 03:05  

3 Buffers.

 

//BUY (buffer  index 0)

 double valBuy = iCustom(Symbol(),PERIOD_H4,"Impulse Indicator",5000,0,1);

 

//NEUTRAL (buffer index 0)

 double valNeutral = iCustom(Symbol(),PERIOD_H4,"Impulse Indicator",5000,1,1); 

 

//SELL (buffer index 0)

 double valSell = iCustom(Symbol(),PERIOD_H4,"Impulse Indicator",5000,2,1); 

To add comments, please log in or register