Getting Partial Close to add ticket to array so it does not try to partial close the same trade twice
Adding to "array" and adding the ticket I'm just not sure how to do it properly.
https://www.mql5.com/en/docs/standardlibrary/datastructures/carraylong/carraylongadd
This line
Trying to add it to this array. Then check if ticket is there before each call if its not run the script if not dont.
https://www.mql5.com/en/docs/standardlibrary/datastructures/carraylong/carraylongadd
This line
Trying to add it to this array. Then check if ticket is there before each call if its not run the script if not dont.
array.Add(ticket); // Adds ticket to the array
(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY && mainProfit >= tradeProfit && !array )Something like this. I'm just stuck.
Documentation on MQL5: Standard Library / Data Collections / CArrayLong / Add
- www.mql5.com
Add(long) - CArrayLong - Data Collections - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
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
What I'm trying to do is to Trail Stop and Partial Close on a Ticket and only do it once. As currently its closing partially twice.
How do I add the ticket to the array and check if ticket[i] != array then we can move sl and close partial otherwise we cannot.
Code attached. I feel like I'm close but just not getting it yet.