Coding help - page 533

 
Jovager:
Thanks Mladen,

But the EA doesn't work.

What have I missed ?

Thanks for your help.

Jo

use these lines for conditions (the lines I posted were for "Parabolic SAR of ma mtf" version 2 :

double currSarSignalUp = iCustom(NULL,0,"Parabolic SAR of ma mtf","",MaPeriod,MaMethod,MaPrice,AccLimit,AccStep,false,2,1);

double currSarSignalDn = iCustom(NULL,0,"Parabolic SAR of ma mtf","",MaPeriod,MaMethod,MaPrice,AccLimit,AccStep,false,3,1);

Also, set the TakeProfit parameter to greater than 10 (you have a condition do disallow trading when that parameter is less than 10). These are the results of a quick test

___________________

PS: I changed the last parameter in the iCustom() call to 1 (closed bar) If you wish you can change it to 0 (current bar)

Files:
test.gif  79 kb
 

Mladen,

After change, the trades opened manually, before EA, were closed by EA, as asked by EA (at changing color)

(The trades were opened manually without MagicNumber, and closed with magicnumber ?????)

But not any trade open. What do you think.

Jo

 
Jovager:
Mladen,

After change, the trades opened manually, before EA, were closed by EA, as asked by EA (at changing color)

(The trades were opened manually without MagicNumber, and closed with magicnumber ?????)

But not any trade open. What do you think.

Jo

Jo

In the code you are never checking for the OrderMagicNumber() (if it is the same with Magic_Number) before closing. Add that control (something like : if (OrderMagicNumber()==Magic_Number) then order can be closed )

 

Sorry.

I think there was a mistake in the attachments .

 
Jovager:
Sorry. I think there was a mistake in the attachments .

Jo

It is the same case : there is no checking if the OrderMagicNumber() is the same as Magic_Number

 

Mladen,

I have a new probleme.

I can't compile the ea, because the Open_Close_MA is write protected ????

What can I do to fix that.

Thanks once more.

Jo

Files:
jovager3.jpg  359 kb
 
Jovager:
Mladen,

I have a new probleme.

I can't compile the ea, because the Open_Close_MA is write protected ????

What can I do to fix that.

Thanks once more.

Jo

Jo

How did you compile before?

 

I always compile the same way.

I click on compile.

 
Jovager:
I always compile the same way. I click on compile.

Sorry, but then I do not know why it does not want to compile now

Try saving it under different name

 

I have shutdown and restart my PC and the problem is fixed.

My question :

As you can see, the indicator say at 18:59 EURUSD changed to up , but at 19:01, not any trade by the EA based on the indicator.

Have you an idea ?

Files:
jovager4.jpg  484 kb
Reason: