How to send an order when an indicator change its color?

 

Hi,

I a newbie in MQL4, and I need some help.

How to send an order when an indicator change its color? I`ve studied about that but I`ve not found the information. I`d like to use the color of an indicator as an entrance parameter to create a condition to send an order. Could anyone help me, please?

Regards,

 
Mctronics:

Hi,

I a newbie in MQL4, and I need some help.

How to send an order when an indicator change its color? I`ve studied about that but I`ve not found the information. I`d like to use the color of an indicator as an entrance parameter to create a condition to send an order. Could anyone help me, please?

Regards,

find out which buffer is linked to which color and then you can use it to determine entry criteria.

 
23510:

find out which buffer is linked to which color and then you can use it to determine entry criteria.

hi,

Try to use this function ObjectGet("object_name", OBJPROP_COLOR);

 
galsa:

hi,

Try to use this function ObjectGet("object_name", OBJPROP_COLOR);


Indicator may not use objects at all. 23510 is right. After buufers are linked to colors use iCustom().

 
robofx.org wrote >>

Indicator may not use objects at all. 23510 is right. After buufers are linked to colors use iCustom().

Hi,

I trying to create an EA that uses the indicator "SR" attached. The entry condition should be as I said before: when the arrow from SR changes the color, I must enter the order.

Could you help me, please?

Regards,

Files:
sr.mq4  4 kb
 
Mctronics:

Hi,

I trying to create an EA that uses the indicator "SR" attached. The entry condition should be as I said before: when the arrow from SR changes the color, I must enter the order.

Could you help me, please?

Regards,

This Ind. Uses 2 Buffers, each buffer has it's own color . So instead of asking about the color U can ask about it's Value.

If the value of 1st buffer is 0, the value of the 2nd buffer > 0, so U can use one IF on One buffer !!

if ( iCustom(Symbol(),TF,"SR",5,240,0,1) > 0 && iCustom(Symbol(),TF,"SR",5,240,0,1==0 ) {

/// Sell

}

else if ( iCustom(Symbol(),TF,"SR",5,240,0,1) == 0 && iCustom(Symbol(),TF,"SR",5,240,0,1>0 ) {

// Buy

}

 
galsa:

This Ind. Uses 2 Buffers, each buffer has it's own color . So instead of asking about the color U can ask about it's Value.

If the value of 1st buffer is 0, the value of the 2nd buffer > 0, so U can use one IF on One buffer !!

if ( iCustom(Symbol(),TF,"SR",5,240,0,1) > 0 && iCustom(Symbol(),TF,"SR",5,240,0,1==0 ) {

/// Sell

}

else if ( iCustom(Symbol(),TF,"SR",5,240,0,1) == 0 && iCustom(Symbol(),TF,"SR",5,240,0,1>0 ) {

// Buy

}

I have an ea when I backtested it for the first time

It is quite fast, but now it takes forever .

Any particular setting I need to set?

Please advise.

Reason: