sieutaymay: i'm newbie trader and I want to learning code EA! I have a question want ask everyone!
I want to get point OrderOpenPrice and OrderClosePrice of orderclosest but I don't know right way???
Please help me! PS: sorry, I speak a little English! Thank you so much!!!
- MQL4 or MQL5? I will assume MQL4 because those functions only exist in MQL4.
- Did you read the documentation for the two functions?
Here are the links: - Those functions are only valid if you use the OrderSelect() function and it is successful (very important).
- Read the documentation on all Trade Functions so you can have a better idea of all of them as a whole.
- Have a look at the CodeBase as there are many examples of code for you to use as a reference for your own code.
OrderOpenPrice - Trade Functions - MQL4 Reference
- docs.mql4.com
OrderOpenPrice - Trade Functions - MQL4 Reference
Fernando Carreiro:
- MQL4 or MQL5? I will assume MQL4 because those functions only exist in MQL4.
- Did you read the documentation for the two functions?
Here are the links: - Those functions are only valid if you use the OrderSelect() function and it is successful (very important).
- Read the documentation on all Trade Functions so you can have a better idea of all of them as a whole.
- Have a look at the CodeBase as there are many examples of code for you to use as a reference for your own code.
thank you so much!!!
I get it by:
if(OrderSelect(1,SELECT_BY_POS,MODE_HISTORY)==true)
{
double price=OrderClosePrice();
if(price>0) Print("Price Open: ", price);
price=OrderOpenPrice();
if(price>0) Print("Price Close: ", price);
}
else
Print("OrderSelect failed error code is",GetLastError());
-
Play videoPlease edit your post.
For large amounts of code, attach it - if(OrderSelect(1,SELECT_BY_POS,MODE_HISTORY)You assume history is ordered by date, it's not. Could EA Really Live By Order_History Alone? (ubzen) - MQL4 forum
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 everyone!
i'm newbie trader and I want to learning code EA!
I have a question want ask everyone!
I want to get point OrderOpenPrice and OrderClosePrice of orderclosest but I don't know right way???
Please help me!
PS: sorry, I speak a little English!
Thank you so much!!!