Help write an expert - page 4

 

Hm... the Expert Advisor is giving 100+ pips of profit on D1 period only...

P. S. I advise not to set barsToSaveSignal too high.

Files:
emaccross.mq4  4 kb
 
Fduch писал(а) >>

Hmmm... expert gives 100+ pips of profit for September on D1 period only...

P. S. I advise not to set barsToSaveSignal too large.

Thank you, I will try to do it now). And what is barsToSaveSignal?

 
In the input parameters there is a comment: "How many bars to save the signal from MA crossing". That is, if the MA crossing signal was. for example, on the third bar, and the Low bar of the MA crossing was broken only now, the position will still open if barsToSaveSignal >3.
 
Fduch писал(а) >>
In the input parameters there is a comment: "How many bars to keep the signal from MA crossing". That is, if the MA crossing signal was. for example, on the third bar, and the Low bar of the MA crossing was broken only now, the position will still open if barsToSaveSignal >3.

>> Got it, thanks.)

 
Vadimus писал(а) >>

>> Got it, thanks.)

I have a question. Why does my Expert Advisor close a position on a profit and then opens a new position on a profit without waiting for MA crossing and then once again... In theory, one crossover means one position opening, if the signal is confirmed.

 

Made to the best of my understanding of the ToR, have a look

Files:
 
Figar0 писал(а) >>

Made to the best of my understanding of the ToR, have a look

>> Thank you, I'm looking)

 
Vadimus >> :

I have a question. The Expert Advisor closes a position on the profit side and opens a new position on the profit side without waiting for MA crossing and then once again... The idea is that one cross is one position opening, if the signal is confirmed.

I warned about barsToSaveSignal. The Expert Advisor "remembers" the crossing during barsToSaveSignal

 
Fduch писал(а) >>

I warned about barsToSaveSignal. The Expert Advisor "remembers" bars crossed during barsToSaveSignal

A trade already executed should cancel it. >> That's how I see it.)

 
"The Expert Advisor closes a position for profit and then opens a new position for profit without waiting for MA crossing and then once again...".

Because the global variables that give the command to open an order should be reset after they have been used once. But this is not done.