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
but if the software got restarted, all the data will be gone.
secondly the average price in the position will used instead of the deal open price.
AmitJamuda solution is the only way to do what you want in MT5/mql5, obvisouly it's not a trivial task and you have to manage persistance of the data.
Anyway what you want is to do the same as in MT4/mql4 with MT5/mql5. Why don't use MT4/mql4 then ? It's a lot more easy to do.
AmitJamuda solution is the only way to do what you want in MT5/mql5, obvisouly it's not a trivial task and you have to manage persistance of the data.
Anyway what you want is to do the same as in MT4/mql4 with MT5/mql5. Why don't use MT4/mql4 then ? It's a lot more easy to do.
No, you are wrong. Open price don't change when you "close" part of a position.
Please study the example closely. The open price is unchanged, Its the average open price that is changing.
See the difference is average price considering that one of the deal is closed.
but if the software got restarted, all the data will be gone.
secondly the average price in the position will used instead of the deal open price.
Please study the example closely. The open price is unchanged, Its the average open price that is changing.
See the difference is average price considering that one of the deal is closed.
opps. I meant average open price.
for example
i open two deal at 100 and 50. Price now is at 75 and I decide to close the deal open at 50. My profit will be 0 right?
Please study the example closely. The open price is unchanged, Its the average open price that is changing.
See the difference is average price considering that one of the deal is closed.
opps. I meant average open price.
for example
i open two deal at 100 and 50. Price now is at 75 and I decide to close the deal open at 50. My profit will be 0 right?
Seems you still don't understand what is a deal, you can said that a deal is open or close, that makes no sense. A deal has a direction, it can be in or out (or in/out but keep it simple). A deal with in direction add to your actual position, the open price of the position is then calculated by averaging price. A deal with out direction reduced your position and open price doesn't change.
In your example, your P/L depends of the direction of your position/deal. Do you have a buy or a sell position at 75 ? Do you have a new deal at 50 which is in or out direction ?
Seems you still don't understand what is a deal, you can said that a deal is open or close, that makes no sense. A deal has a direction, it can be in or out (or in/out but keep it simple). A deal with in direction add to your actual position, the open price of the position is then calculated by averaging price. A deal with out direction reduced your position and open price doesn't change.
In your example, your P/L depends of the direction of your position/deal. Do you have a buy or a sell position at 75 ? Do you have a new deal at 50 which is in or out direction ?
Terms aside. Lets use layman terms.
In my given example. I buy at price 100 (1 lot) and at 50 (1 lot). My average open price would be 75 correct?
When the price is at 75 and I decided to close 1 lot. For the closed position of 1 lot, my profit would be 0 correct?
Terms aside. Lets use layman terms.
If you do not use the correct terms you cannot communicate effectively . . .
Orders, Positions and Deals in MetaTrader 5