My EA seems to be in a loop! Help please! - page 2

 

RaptorUK I am not using the Strategy Tester to run this EA. Is it still necessary to have a minimum number of records to run this EA on a demo/live account?

I do have varying amounts of data in everyone of these currency pairs as it is. (minimum 2048 records of H1 data)

The first instrument in my Symbols array is EURUSD. Why does the EA not start with that pair but only runs the pair that it is loaded on?

Are you sure my code is correct?

 

With MT4 strategy tester you can not use multiple symbols' data, only the one you select.

Otherwise check if this variable "i" what you use to walk though your Symbols array is not changed later in the loop.

      for(int i=0;i<ArraySize(Symbols);i++)
 
ernest02:

RaptorUK I am not using the Strategy Tester to run this EA. Is it still necessary to have a minimum number of records to run this EA on a demo/live account?

I do have varying amounts of data in everyone of these currency pairs as it is. (minimum 2048 records of H1 data)

The first instrument in my Symbols array is EURUSD. Why does the EA not start with that pair but only runs the pair that it is loaded on?

Are you sure my code is correct?

You have 28 symbols, unless you have a chart open for each you will not be downloading the latest data for each . . . unless you have something else requesting it, lets assume you don't.

So when you call . . .

UpLong = iCustom(Symbols[i],TimeFrame,"NonLagMA_v7.1",PriceModeLong,LengthLong,0,FilterLong,1,0,0,0,0,1,1);

. . . what is TimeFrame ? what is PriceModeLong ? what is LengthLong ? the Indicator will run and try to execute it's code on the bars you want of the timeframe specified, do you have these bars already loaded ? for all 28 pairs ? are they kept upto date ? when a bar on "Timeframe" timeframe has passed and a new bar arrives how do you retrieve it ?


If you don't have anything keeping the data up to date then you need to add code to do just that, try to read the Open price for bar 0 for the Timeframe you are interested in for each of the symbols in turn, then check for an error 4066, if you get an error 4066 wait for 10 seconds . . then try again.

 
szgy74:


With MT4 strategy tester you can not use multiple symbols' data, only the one you select.

Yes, you can . . . but it's not relevant . . . "RaptorUK I am not using the Strategy Tester to run this EA."
 
RaptorUK:
Yes, you can . . . but it's not relevant . . . "RaptorUK I am not using the Strategy Tester to run this EA."


excuse me, I read it too quickly and misunderstood.
 

RaptorUK,

Thanks a million for your help and advice.

I have decided that scanning multiple pairs in one EA and testing them one by one against certain criteria is just too complicated for a beginner like me.

I have now adapted my EA and am now loading my EA on each individual currency pair and I get good alert signals from this. this is much more laboursome, but I will stick to this for the moment.

Thanks again foe your help!


Ernest.

 
ernest02:

RaptorUK,

Thanks a million for your help and advice.

I have decided that scanning multiple pairs in one EA and testing them one by one against certain criteria is just too complicated for a beginner like me.

I have now adapted my EA and am now loading my EA on each individual currency pair and I get good alert signals from this. this is much more laboursome, but I will stick to this for the moment.

You are welcome it really shouldn't be too difficult . . . perhaps you could write a simple test EA to investigate this particular issue just for one or two pairs that you don't have charts open for . . . that would allow you to investigate and fix the issue for a couple of cases, once you have it sorted it's a simple task to expand it to many more symbols . . . just a suggestion.
 
ernest02:

RaptorUK,

Thanks a million for your help and advice.

I have decided that scanning multiple pairs in one EA and testing them one by one against certain criteria is just too complicated for a beginner like me.

I have now adapted my EA and am now loading my EA on each individual currency pair and I get good alert signals from this. this is much more laboursome, but I will stick to this for the moment.

Thanks again foe your help!


Ernest.

Do this:

A..go to MT4 history directory & check if you have files that look like below for all symbol pairs that you are scanning in EA:

EURUSD1.HST
EURUSD5.HST
EURUSD15.HST
EURUSD30.HST
EURUSD60.HST
EURUSD240.HST
EURUSD1440.HST
EURUSD10080.HST
EURUSD43200.HST

B..if any missing then you have to 'create' as follows:

1..open any chart
2..drag a pair from market watch area to the chart.
3..click on M1, pause, click M5, pause, click M15, pause, click M30, pause, click H1, pause, click H4, pause, click D1, pause, click W1, pause, click MN1, pause. in some cases yu will see "Waiting for Update" during pause & then chart will be filled, this action will download history data from Broker for all the mentioned periods(TFs).

C..repeat B for all the 28 pairs one by one, close terminal. Check MT4 histroy directory & you will find that all your pairs have .HST files for all timeframes. Once .hst file pre-exists, it gets updated from Broker every 1 or 2 minutes (depends on Broker).

This is spoonfeeding..but for newbie an important step to learn.

Before Build 509 above was taken care of by Compiler, but after 509 I also had the same problem as you do on a multi-currency-multi-period scanner and solved it this way.

RaptorUK & WHRoeder have already hinted you the same thing..but you could not ride on...

As such your running of EA on each chart is just fine as well..but it will take a lot of memory..

Regards...
T.
 
Tasleem:


C..repeat B for all the 28 pairs one by one, close terminal. Check MT4 histroy directory & you will find that all your pairs have .HST files for all timeframes. Once .hst file pre-exists, it gets updated from Broker every 1 or 2 minutes (depends on Broker).

Nope, the data is updated tick by tick but only f there is a chart for the symbol in question, the data is also updated on demand if an Indicator/Script or EA that needs the data but then there can be a delay in the data being retrieved . . . hence the error 4066 check and wait . . .
 
RaptorUK:
the data is also updated on demand if an Indicator/Script or EA that needs the data but then there can be a delay in the data being retrieved . . . hence the error 4066 check and wait . . .

Can you please show me a working example of 4066 checking?

I have several problems with the update of missing history data but NEVER got the 4066 (with GetLastError), I tried many places (in the code).

Reason: