Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 551

 

Let's say OrderOpenPrice is at 23%, when the price reaches 76% StopLoss is moved to 51%.

 
Example2:

I didn't write it as a rebuke, just so others can see. Thank you for your time.

Yeah, no problem. It's just that there are rules that must be strictly adhered to. For example, in https://forum.mql4.com/ru/60554/page102#930568 a person doesn't initialize variables and gets the wrong thing! That's how prices are normalized. As a rule, TP and STOP order levels are calculated and therefore their accuracy is uncertain. Get used to following the rules - you will save yourself a lot of problems. Sometimes you can spend a month looking for such a mistake as 1 in the 16th digit. So, study textbook and forum examples carefully. Now the new build is about to be tested and the number of educated people will decrease dramatically. The last code you have cited will work for you.

The last code that you cited will work, but it is not literate, that's how the wrong habits will take root!

 
vidnab:

Let's say OrderOpenPrice is at 23%, when the price reaches 76% StopLoss is moved to 51%.



OK, I buy a couple of lots of Eurobucks at 1.3926... Where does 23% or 51% or 76% come from.
 
Well the price of 1.3926 at which the order is opened is the 23% Fibonacci level, and when the price reaches the 76% level, the stop should be moved to the 51% level.
 
And in this line if (pp-OrderOpenPrice()>LevelProfit*po), we need to put that the last price is the opening price of the order > than the opening price plus 51%. And move the stop in this line ModifyOrder(-1, OrderOpenPrice()+LevelWLoss*po, -1); by the opening price +28%.
 
That is, if (pp-OrderOpenPrice()>OrderOpenPrice()/23*51*po) like this. But it doesn't work that way.
 
vidnab:
Well, the price of 1.3926 on which the order is opened is the 23% Fibonacci level, and when the price reaches the 76% level, the stopper should be moved to the 51% level.

So your fibo is stretched... probably between some two levels... The Expert Advisor should be able to guess what those levels are and that this order was opened at 23% and not just opened from scratch.

There are more questions than answers in your task.

 
No, he doesn't have to guess. You just score him the opening price is 23%, when it reaches 76% move it to 51%.
 
Add digits to the code once and that's it. And it will be based on the opening price.
 
vidnab:
They should not guess what they are. You just tell him the opening price is 23% and when it reaches 76%, you move it to 51%.


OK, I gave you an example, the opening price is 1.3926. Now tell me the price of 76% based on this figure.

You can only manually set the required level of profit and stops. You have to enter the market with a certain percentage in your head, and the Expert Advisor cannot access it.

Reason: