bentbawer:
and the code only runs if the order's lot is 2x the min_lot.
I also noticed that the original order changes its ticket number after the lock in.
My question is more of logic than of coding, at least for now. How can i tag a particular ticket so it doesn't get "locked in" more than once?
- Of course you have have the half size order below min_lot
- Of course.
- You need a method to determine whether you already have. I simply move the SL above BE before the partial close.
Hi WHRoeder,
Thanks for your reply. Just a quick clarification, if you would.
So you are saying that your technique is to move the SL above BE and then close half stake? This way you make your code know if a particular order has been "locked in" by the position of the SL in regards to the OrderOpenPrice()?
Thank you.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello there,
I created a code to lock in profit after a XX number of positive pips has been reached. The problem is that i created this code to use on EA in my live account, where i could only afford 2x the minimum lot and the code only runs if the order's lot is 2x the min_lot.
When i used this EA in a demo account with more money, the code repeated itself several times. I also noticed that the original order changes its ticket number after the lock in.
My question is more of logic than of coding, at least for now. How can i tag a particular ticket so it doesn't get "locked in" more than once?
This is my code:
Thanks