Counting Partial Close for a trade

 

When you close a trade partial, you see it get a comment "from # ticketnumber" and in the order history it get the comment "to # ticketnumber"

When i want to code 3 partial close areas for a trade, then i need to count how often i have already close partial from the first trade, but i am looking for a good logic way how to count how often i have already done partial close on that trade, in the order comment i can only check if i have make already once a partial close, if there is no comment which say "from #" then i know this trade have not been close partial, but how could i check if this trade have been close partial for example 2 or more often?

 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
Email Account:

When you close a trade partial, you see it get a comment "from # ticketnumber" and in the order history it get the comment "to # ticketnumber"

When i want to code 3 partial close areas for a trade, then i need to count how often i have already close partial from the first trade, but i am looking for a good logic way how to count how often i have already done partial close on that trade, in the order comment i can only check if i have make already once a partial close, if there is no comment which say "from #" then i know this trade have not been close partial, but how could i check if this trade have been close partial for example 2 or more often?

Using comment to identify anything about a order would be broker dependent … on some brokers you have diferent comments or no comments … use a counter … count how many times you closed and store that … there are many ways … I believe you like take partials at diferent levels … then … that level price can be a trigger… once you take a partial , set a new level … and increase counter by 1 
Reason: