Avalanche - page 41

 
Something MT glitched at me:) for some reason, suddenly in the tester on the euro / Bx stop levelled at 100 points:) Naturally, the orders did not open with a 130th error ... I thought my Expert Advisor was screwed up... That's why I deleted the post... Reloaded MT - everything worked:)
 
restarted the terminal until the restart failed ^_^
All the time 130, on different terminals, maybe it's the code after all ? )
 
No... everything works... Watch step parameter - it should be at least 2 times bigger than the instrument's stoplap. The reason is that the pendants are set at the same distance from the price. Respectively, the parameter "Step" is the width of the corridor. Click on the symbol properties in the tester and make sure...
 
By the way... If it' s a five-digit number, then the step parameter should also take this into account... So the five digits should be set to 200 instead of 20 (e.g.).
 
lexandros писал(а) >>


profit fixing takes place - when this profit is reached... The profit is fixed when the eq_profit parameter is reached (in pips) and everything is closed out globally.


Yes, I have found it. It is provided, but you have if (all_prof>=profit) close_all(); it should be if (all_prof>=eq_profit) close_all(); But somewhere in the profit calculation there is an error. As it works incorrectly.
 
if (count_buy>0)prof_buy=prof_buy*(0.1/(lot_buy/count_buy));
if (count_sell>0)prof_sell=prof_sell*(0.1/(lot_sell/count_sell));

an error in these lines:

 
khorosh >>:


Да нашёл. Предусмотрено, но у вас if (all_prof>=profit) close_all(); а должно быть if (all_prof>=eq_profit) close_all(); Но где-то в вычислении профита есть ещё ошибка. Так как работает неправильно.


Um... you must have misunderstood the code...
it should be exactly as it is.
The variable prof is passed to the function as a parameter.
there is no error in this function... it's certainly not written for this toy... it has been working successfully in other serious EAs for a long time.
 
lexandros писал(а) >>


Um... you must have misunderstood the code...
it should be exactly as it is.
the variable prof is passed to the function as a parameter.
there is no error in this function... it's certainly not written for this toy... it has been working successfully in other serious EAs for a long time.


Yes, my mistake, my fault. I did not notice that this code is inside the function. This is what you get when fixing profit = 1$ from 01.11.09 till today.
 
lexandros писал(а) >>


Um... you must have misunderstood the code...
it should be exactly as it is.
the variable prof is passed to the function as a parameter.
there is no error in this function... it's certainly not written for this toy... it has been working successfully in other serious EAs for a long time.


I have a question for you in the codebase about cfp Waiting for you there :)
 
I apologise too :)
I really didn't calculate the profit correctly.
The function was pulled from another EA, which counted profit separately for long and short positions... I did not even think about it.
I literally just did it on my knees, so sorry...
Here's the revised version.
Files:
swing_3.mq4  10 kb