Help with EA CODE - page 2

 
RaptorUK:
Can you go through what you are doing to get this EA to run in the Strategy tester . . . for example, do you have history data for the date period you are trying to run ?

1. I compile the EA in MetaTrader. (no errors)

2. I got to the MetaTrader platform and click on strategy tester.

3. I click the dropdown EA button and look for my EA and click on it.

4. The only external input for my EA is the percentage I want to risk. I enter 2 to risk 2 percent of Equity.

5. I click on the M30 time frame.

6. I ran the test for the entire week.

7. press start.(The strategy Tester pops up a chart, but doesnt run)

 

OK, good info.

What Model are you using ? Every tick ?

Do you have M1 data for the period you are trying to run ? open a chart of the same symbol switch to M1 scroll to the date you are trying to run on Strategy Tester to make sure you have the relevant M1 data.

Do you have Visual mode ticked ? and Optimization not ticked ?

 
RaptorUK:

OK, good info.

What Model are you using ? Every tick ?

Do you have M1 data for the period you are trying to run ? open a chart of the same symbol switch to M1 scroll to the date you are trying to run on Strategy Tester to make sure you have the relevant M1 data.

Do you have Visual mode ticked ? and Optimization not ticked ?


Every tick.

optimization is not checked.

The M1 data I have is from the broker.

I tried you M1 but the same problem, it doesnt start.

 
jeemba2012:

I tried you M1 but the same problem, it doesnt start.

No, I didn't mean run the Strategy tester on M1 I meant open up a standard chart for the Symbol you want to test, switch to M1 timeframe and scroll to the date you are trying to test . . . what date are you trying to test ?
 
Do you have Visual mode ticked ?
 
RaptorUK:
Do you have Visual mode ticked ?

yes

here is my EA

 

OK, I compiled your code and ran it in the Strategy tester . . . I see what you mean . . . I found the immediate issue . . .

 //check time 
     if( Hour() != 10 )
     {
       while(10 != iTime(Symbol(),PERIOD_M30,i) ) i++;   //  change this . . .

 //check time 
     if( Hour() != 10 )
     {
       while(10 != iTime(Symbol(),PERIOD_M30,i) ) {i++; Print("i= ",i);}   // to this, run the EA, watch the journal tab, i just counts up and up
 

What I was trying to do is calculate the highest/lowest CCI for the trading day of london.

I referenced 10 because according to my server, the is equivalent to the London open at 8:00 am.

So if the Chart is opend at lets say 2:00pm in London(16:00 my server time) I want the code to find the lowest/highest CCI for the day starting from the open at 8:00am in London(10:00 my server time)

 
jeemba2012:

I tried this suggestion. But how will the print statements help if it the strategy tester will not start the EA. is there another way to use the print statements?

I deleted all my pivot point indicators and downloaded fresh without renaming it. and tried your suggestion but it still did not work.

  1. Add print statement. If it won't start, no print, nothing in the journal. If it starts, entry in the journal. Thats how is helps.
  2. Did you compile the indicator after downloading it? I don't believe it compiles itself on terminal startup.
  3. After the iCustom, print GetLastError() so you find out why.
 
WHRoeder:
  1. Add print statement. If it won't start, no print, nothing in the journal. If it starts, entry in the journal. Thats how is helps.
  2. Did you compile the indicator after downloading it? I don't believe it compiles itself on terminal startup.
  3. After the iCustom, print GetLastError() so you find out why.

I found it thanks. Raptor found the error in my code
Reason: