EA problem HELP

 

Hey guys,

I have an EA which trades very very good if I turn by the Strategy Tester from "Tick Mode" tot "Open Price (fastest methode)"

So but in the realtime mode there is always the "Tick mode" and how can i change it to the "Open Price (fastest methode)"

Can somebody help me please?

I will share this EA if its working . Thanks

 
123456781:

Hey guys,

I have an EA which trades very very good if I turn by the Strategy Tester from "Tick Mode" tot "Open Price (fastest methode)"

So but in the realtime mode there is always the "Tick mode" and how can i change it to the "Open Price (fastest methode)"

Can somebody help me please?

I will share this EA if its working . Thanks


Is the symbol in the navigator before your EA name grey or colored blue and yellow

If it is grey we can't help ....

If it is colored you have to change the EA it that way it only open and close the trades by opening new bar

 

its colored.

What i have to do?

 
123456781:

Hey guys,

I have an EA which trades very very good if I turn by the Strategy Tester from "Tick Mode" tot "Open Price (fastest methode)"

So but in the realtime mode there is always the "Tick mode" and how can i change it to the "Open Price (fastest methode)"

You have to modify your code so it only reacts to the open price of new bars, not all ticks . . . I think.

 

thanks but.. how can I do this ;) ??

Whats the code

 
   if (TimeM1==iTime(NULL,PERIOD_M1,0)) return(0);
   TimeM1=iTime(NULL,PERIOD_M1,0);

Put this at the beginning of start(), and change the timeframe as appropriate.

 
If I put it in . the EA doesnt work
 
123456781:
If I put it in . the EA doesn't work

Yes and I bet it doesn't compile if that's all you did. It was implicit that you would put either

static datetime TimeM1=0;

as the first line of the start function or

datetime TimeM1=0;

as a global variable before the start function.

 
int start(){
   static datetime Time0; if (Time0 == Time[0]) return(0); Time0 = Time[0];
   : // Start of a new bar.
 
WHRoeder:

You will notice that WHR's version uses Time[] rather than iTime(). Since you are using the current symbol and the current timeframe it is simpler to use the Time[] array rather than the iTime function.
Reason: