Questions from Beginners MQL5 MT5 MetaTrader 5 - page 430

 
Leanid Aladzyeu:
I do not understand under what situation an EA may not open a trade, and at the same time not give errors. In the test everything works and 0 errors on a 15 year history.

These are runtime errors. And the tester simulates "ideal conditions", it does not take into account connection interruptions, requotes, outages, hang-ups, etc. experts, etc.

Hardly anyone can help you without a code.

 
Tapochun:

These are runtime errors. And the tester simulates "ideal conditions", it does not take into account connection interruptions, requotes, outages, hang-ups, etc. experts, etc.

Hardly anyone can help you without code.

increased the slippage instead of 2 pips set to 3.

is this normal ? i haven't used inite before

 
Leanid Aladzyeu:

increased the slippage by 3 points instead of 2.

is this normal? i have never used init before

About the execution errors yes there were"wrong price " but the wrapper waited 0,5 sec. and again sent an order to the server and opened an order.

There was a Volume[0]<5, i increased it to Volume[0]<15.

 
Leanid Aladzyeu:

increased the slippage by 3 points instead of 2.

is this normal? i have never used init before

This is the reason for deinitialisation. The OnDeinit() function.
 
Leanid Aladzyeu:

About execution errors yes there were "wrong price" but the wrapper waited 0.5 sec. and again sent an order to the server and opened an order.

There was a Volume[0]<5, increased it to Volume[0]<15.

Was it a wrong price in the tester?

About Volume[] - I don't see the code, I don't know what this or that array is responsible for...

 
Tapochun:
This is the reason for deinitialisation. OnDeinit() function.
Ah got it thanks.
 
Tapochun:

Was the price in the tester wrong?

About Volume[] - I don't see the code, I don't know what this or that array is responsible for...

No, it was not the right price when I re-loaded the Expert Advisor onto the chart.

Volume is a kind of filter for a new candle. I think that one of the reasons may be the fact that some strategies have 5 and 10 ticks but they are at the bottom of the code, as they are less risky and do not need fast processing.

 

Please give me a hint,

I've read the instructions but don't understand it(

If I do the OnCalculate function in a trading Expert Advisor

all code is defined as indicator????

 
pr0gre5:

Please give me a hint,

I've read the instructions but don't understand it(

If I do the OnCalculate function in a trading Expert Advisor

all code is defined as indicator????

No. It will be gibberish.
 

What is the easiest way to build an Expert Advisor that receives a signal from its indicator and places an order?

I tried to do it via include file - it complains about two OnInit when compiling

Please suggest an easier article on the subject.

Reason: