• Get access

EMA in EA showing value 1 ...

To add comments, please log in or register
Edi Dimitrovski
289
Edi Dimitrovski  
Is this correct, I can't find my mistake. When chart is open it's showing 2 lines MA with "Period 1" - Code in script is:
sig0 = iMA( NULL, 0, 12, 0, MODE_EMA, PRICE_CLOSE, 0) * 2 - iMA( NULL, 0, 26, 0, MODE_EMA, PRICE_CLOSE, 0);
main0 = iMA( NULL, 0, 21, 0, MODE_EMA, PRICE_CLOSE, 0) * 2 - iMA( NULL, 0, 35, 0, MODE_EMA, PRICE_CLOSE, 0);
sig1 = iMA( NULL, 0, 12, 0, MODE_EMA, PRICE_CLOSE, 1) * 2 - iMA( NULL, 0, 26, 0, MODE_EMA, PRICE_CLOSE, 1);
main1 = iMA( NULL, 0, 21, 0, MODE_EMA, PRICE_CLOSE, 1) * 2 - iMA( NULL, 0, 35, 0, MODE_EMA, PRICE_CLOSE, 1);
...
if ( ( sig0 > main0 ) && ( sig1 <= main1 ) && ( sig1 < sig0  ) ) BuyCond = 1;
if ( BuyCond != 0 ) ...
To add comments, please log in or register