issue on getting open price using HistoryOrderGetDouble(trans.position,ORDER_PRICE_OPEN) - page 2
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
Dear vlad,
I know what I'm talking about and it is not my mis perception on the different trades definitions. to get aligned you may see my definitions below :
the order which i mentioned is not pending order or so... over trade history if you change the view model to deals, you may see the same titles there.
It is the MT5 and MQ5 which is using this ORDER number and return these values on TradeTransaction as well.
Finally to answer your question and clear up the requirement in a sentence:
I'm looking for the OPEN_PRICE of the original Position which its SL hit at the moment.
I'll think about the code, the preliminary algorithm is as follows:
We caught a transaction - Stop Loss triggered. Find the deal that generated this transaction. Get the 'Position identifier' property from this deal. We select all trades using 'HistorySelectByPosition'. In this case, finding the very first deal is very easy.
Thanks again for the comment
i checked some buy i couldn't find what do you mean by position Identifier over the deal
can you please explain more or provide me with the function or variable which i can find this identifier?
Thanks again for the comment
i checked some buy i couldn't find what do you mean by position Identifier over the deal
can you please explain more or provide me with the function or variable which i can find this identifier?
Code:
Price of position opening.mq5
thanks a lot Vlad...
i got the concept and what i should looking for.
Aas I'm working directly with OrderSend and not using CTrade, my code will be a bit different. but I will check and inform you the results.
Thanks again
Thanks Vlad for your support.
the issue has solved with below code easily
but still it remained unanswered why the original function cannot resolve the proper value
Thanks Vlad for your support.
the issue has solved with below code easily
but still it remained unanswered why the original function cannot resolve the proper value
This is my question too!!!
I'm using this code for last closed positions information such as TP/SL/opened price/lot.. .
I'm selecting history correctly (tested).
I'm selecting Order correctly(tested).
But just Loti size can be returned correctly by this way!!
Thanks Vlad for your support.
the issue has solved with below code easily
but still it remained unanswered why the original function cannot resolve the proper value
Hi, have you solved this issue with the built-in functions way?
I'm having the same issue, it's weird because I can't get opening price of Order by using HistoryOrderGetDouble even if I call HistorySelectByPosition before.