iCustom to do this?

 

Hello Guys,


Think this froum can be very helpful so I ask this question:


1) Im trying to pull a value from an indicator into an EA. The indicator is a custom indicator which I believe requires me to use icustom. The code from the indicator that has the value I want is this:


if (LevelForDmax>=LivelDA4618 && LivelDA4618>=LevelForDmin)
{
nameObj="_"+ExtComplekt+"PDLA4618_" + countGartley + "";
ObjectCreate(nameObj,OBJ_TREND,0,Time[aXABCD[C]],LivelDA4618,timeLineD,LivelDA4618);
ObjectSet(nameObj, OBJPROP_COLOR, ExtLineForPointD_AB);
ObjectSet(nameObj, OBJPROP_RAY, false);
}


So basically, I want the value (price) of this object into my EA. It draws a little line on the chart and thats the value I would like to have stored in a variable in my EA.


Can someone advise a new guy trying to get into mql how to do this?


Thnak you!!

 
trader346:

Hello Guys,


Think this froum can be very helpful so I ask this question:


1) Im trying to pull a value from an indicator into an EA. The indicator is a custom indicator which I believe requires me to use icustom. The code from the indicator that has the value I want is this:


if (LevelForDmax>=LivelDA4618 && LivelDA4618>=LevelForDmin)
{
nameObj="_"+ExtComplekt+"PDLA4618_" + countGartley + "";
ObjectCreate(nameObj,OBJ_TREND,0,Time[aXABCD[C]],LivelDA4618,timeLineD,LivelDA4618);
ObjectSet(nameObj, OBJPROP_COLOR, ExtLineForPointD_AB);
ObjectSet(nameObj, OBJPROP_RAY, false);
}


So basically, I want the value (price) of this object into my EA. It draws a little line on the chart and thats the value I would like to have stored in a variable in my EA.


Can someone advise a new guy trying to get into mql how to do this?


Thnak you!!

e.g

extern double Chosen_Level=5.0; // Just an example

double Custom_Indy=iCustom(Symbol(), 0, "Name of Custom Indy","extern setting of indy","number of buffers in the custom indy","chart shift:0=current candle");


then :


if(Custom_indy>=Chosen_Level)

{

Ordersend(...);

}

Reason: