I'm new at programming so any help would be appreciated. I'm trying to build a EA using the IINMARROWS indicator with the MACD Sample EA.I called it rk-IINMA-sample. Not so simple. I got it to compile but it won't trade. Any ideas where I went wrong?? I'm attaching the Broken EA, if need be I'll attach the other files. These are some of the journal entries:
2010.01.28 22:43:36 RK-IINMA-Sample inputs: TakeProfit=0; Lots=0.1; TrailingStop=0; FasterMode=3; FasterMA=3; SlowerMode=3; SlowerMA=3;
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.2520 at 2010.01.19 13:00 is not reached from the least timeframe, high price 91.0800 mismatches)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:03 and price 91.0590 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:02 and price 91.0630 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:01 and price 91.0600 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:00 and price 91.0510 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.0520 at 2010.01.19 10:53 is not reached from the least timeframe, low price 91.2020 mismatches)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:57 and price 91.2280 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:56 and price 91.2400 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:55 and price 91.2480 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:54 and price 91.2490 mismatched)
Search for 'unmatched data error'
Your Ea looks like a morphed indicator. I am not sure what indicatorcounted() will do in an EA its for indicators. Explain what you are trying to do with the loop and maybe people can help you.
int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; //---- limit=Bars-counted_bars; for(i=0; i<=limit; i++) { counter=i; Range=0; AvgRange=0; for(counter=i ;counter<=i+9;counter++) { AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]); } Range=AvgRange/10; fasterMAnow=iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i); fasterMAprevious=iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i+1); fasterMAafter=iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i-1); //---- L-60 slowerMAnow=iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i); slowerMAprevious=iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i+1); slowerMAafter=iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i-1);
This code needs a makeover.
It looks like it is indicator. for this reason mt4 compiles it but can not run... move it to indicator folders in order for indicators to run.
p.s. compiler can not return error on logical errors.
f.e.
while (x > 0)
{
x = 10 // logical error.
x++
}
will compile but will loop the code.
EA's do not have a countedIndicator
EA's normally do not loop, the start() is called once per tick.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm new at programming so any help would be appreciated. I'm trying to build a EA using the IINMARROWS indicator with the MACD Sample EA.I called it rk-IINMA-sample. Not so simple. I got it to compile but it won't trade. Any ideas where I went wrong?? I'm attaching the Broken EA, if need be I'll attach the other files. These are some of the journal entries:
2010.01.28 22:43:36 RK-IINMA-Sample inputs: TakeProfit=0; Lots=0.1; TrailingStop=0; FasterMode=3; FasterMA=3; SlowerMode=3; SlowerMA=3;
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.2520 at 2010.01.19 13:00 is not reached from the least timeframe, high price 91.0800 mismatches)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:03 and price 91.0590 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:02 and price 91.0630 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:01 and price 91.0600 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.1520 at 2010.01.19 13:00 and price 91.0510 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (low value 91.0520 at 2010.01.19 10:53 is not reached from the least timeframe, low price 91.2020 mismatches)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:57 and price 91.2280 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:56 and price 91.2400 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:55 and price 91.2480 mismatched)
2010.01.28 22:43:36 TestGenerator: unmatched data error (high value 91.1520 at 2010.01.19 10:54 and price 91.2490 mismatched)