-
Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Counter is not used; remove it and the if, and simplify:
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) && OrderTicket() > bigTicket ){ && OrderMagicNumber() == MAGICMA_n && OrderSymbol() == Symbol()) ){ bigTicket = OrderTicket(); lastLotsOrder = OrderLots(); }
-
- "Doesn't work" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key,
flat tires — meaningless. The code is fine (except for the next two points.)
- Do not assume history has only closed orders. Need
to check the type.
OrderType() == 6, 7 in the history pool? - MQL4 programming forum - Do not assume history is ordered by date, it's not. Last ticket may not be the last
closed. What do you mean by "last order?"
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum
- "Doesn't work" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key,
flat tires — meaningless. The code is fine (except for the next two points.)
Thank you bro for you answer !
sorry my english !! this not my native language i am learning yet !!

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 !
Can you help me with a doubts ?
I need informations about Lots of the Last order.
I'm making this:
My objetive in the function getLastLotOrder is return the lot of the last order.
But doesn't working, can you help me? thankssss