Help coding ea
I'd include the indicator but I think there's an error at this code:
int i_ma() { double ima_high = iCustom(NULL,0,"DynamicRS",5,25,MODE_HIGH,0); double ima_low = iCustom(NULL,0,"DynamicRS",5,25,MODE_LOW,1); if (Close[1] < (ima_high + 5)) return (-2); if (Close[1] > (ima_low - 5)) return (2); return (0); }
I'd include the indicator but I think there's an error at this code:
double ima_high = iCustom(NULL,0,"DynamicRS",5,25,MODE_HIGH,0); // bar number to calculate buffervalue 'mode' from indicator "DynamicRS" double ima_low = iCustom(NULL,0,"DynamicRS",5,25,MODE_LOW,1); //wrong
mode | - | Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. |
looks like the name mode is confussing you
an indicator can have 8 buffers maximum you can read with using iCustom
mode stands for the buffer of the indicator you wanna read
it has nothing to do with mode_high mode_low mode_open or ........
the last parameter is for the bar you want the value from
mode | - | Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions. |
looks like the name mode is confussing you
an indicator can have 8 buffers maximum you can read with using iCustom
mode stands for the buffer of the indicator you wanna read
it has nothing to do with mode_high mode_low mode_open or ........
the last parameter is for the bar you want the value from
OK, I got it... thanks for your explanation.

- Free trading apps
- Free Forex VPS for 24 hours
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I want to include the indicator to ea. The logic is: if price close above the red line then op buy and if price close below the green line op sell.
Can anybody help me..? Sorry about my english.