I will write an advisor free of charge - page 86

 
Konstantin Nikitin:
Something like that.
The further into the woods, the less clear it becomes.
 
Николай:
The further into the woods, the less clear it becomes.

I updated the last code, it's more convenient that way.

And according to that structure and its use, you should look at the whole code and then draw conclusions.
Work it out little by little. In time you will more or less understand.
 
Konstantin Nikitin:

I updated the last code to make it more convenient.

And according to the structure and its use, we should look through the whole code and come to conclusions.
You understand little by little. In time you will more or less understand.

Thank you very much, could you please tell me in the code this variableinfoOrder.MaxDist=MathAbs(OrderOpenPrice()-BID); it basically shows the distance from order open price to current price in pips ?

 
Николай:

Thank you very much, could you please tell me in the code this variableinfoOrder.MaxDist=MathAbs(OrderOpenPrice()-BID); it basically shows the distance from the order open price to the current price in pips ?

Not exactly with your calculation. The distance in pips is as follows

infoOrder.MaxDist=MathAbs(OrderOpenPrice()-BID)/Point();

We'd better convert it to int in this case.

struct InfoOrder
{
     int ticket,
         MaxDist;
     double lot,
            profit,
            swap,
            commission,
            sl, tp;
     datetime timeOpen;
     string comment;
} infoOrder;
 
Konstantin Nikitin:

Not really with your calculation, in points it would be like this

And it's better to convert to int then.

Thank you very much.
 
Hello Mr. programmers, please help me to update my EA. I need to write a function which would close the order (order group) with profit, and close the furthest from the current price opposite direction order completely or partially, depending on the profit, and equip the EA.
 
My head is all messed up, not enough knowledge. I need help.
 

I wrote and screwed it to the EA, for some reason it's not working, if you can look it up, maybe you'll find the reason.

Thanks for that.

Files:
qxms1p.mq4  15 kb
 
Hello! Would anyone be interested in an indicator in the form of a cluster search that would find clusters with a given value on the chart and mark them with a shape. Analogue to ATAS
 
sanzvet:
Hello! Would somebody be interested in the cluster search indicator that would find clusters with a given value on the chart and mark them with a shape. Analogue of ATAS

What instruments would it work on? If on the FORTS, including the processing of tick history, it is interesting.

Reason: