-
int ticket = OrderTicket(); if(ticket == OrderTicket()
That test will always be true.
- Remember the datetime when you do the partial close.
William Roeder #:
-
That test will always be true.
Yeah… I know… I wanted to see if after partial has been taken, if OrderOpenTime will be different… for the new ticket… sims like is not… it will be always initial opening
- Remember the datetime when you do the partial close.
Not sure how… I will try to use GlobalVariableTime… I use GVset() as a on/off switch for the partial profit… I try to get the time for switch changing with GVTime()… but I have one more question about GlobalVariables… I use GVset( string name, double AAA) in this EA for one chart… I use the same EA on another chart with the same GVset(string name,double BBB)… the value stored in memory AAA and BBB will be different… but if it is stored under the same name… when I call GVget(string name)… which value do I get… AAA or BBB ? What I mean is… whatever variables I set in chart 1 it will not interfere with the values from another chart? If they have the same name?
![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
Hi guys! So I have below code:
which is closing a trade if is too much time past since opening and profit is below a certain level... the issue is that this EA opens a trade and at crtain level, is partialclosing half of the trade...at this point the profit will be smaller and will fall under the ClosingOldTrade function and it will close the trade...what I need is How to start counting the time for the new ticket which is issued after partial close...Not sure if is understandable what I just said...maybe if I catch the initial ticket into a GlobalSetVariable ?? and compare it with the second ticket after Partial Close ??