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
If you are transitioning from MT4 to MT5, you will find that the trading mechanism is completely different.
So, I suggest you start by first learning how to understand the MT5 trading mechanisms and how to use the MQL5 trade functions ...
I also highly suggest you study the MQL5 programming for traders - Book on MQL5.com too.
Thank you Fernando, i appreciate it!
And yes the difference positions, orders and deals, hedging and netting are clear, i use only positions and mainly orders, no deal detail informations are used, no partial executions are used = i can use anything in positions*/orders* for my EA...except "OrderCloseTime" :)
my EA works 90-95% with global variables and array's, therfor the memory usage is high...64bit is better the 32bit, multithread ist better then monothread...
I can use, based on latest informations:
1) positions*/orders* + deals:OrderCloseTime
2) deals only (bloating the code)
my main problems are with date, datetime struct conversion MQL4->MQL5
and i cant understand why i'm seein in history! tab/positions only: Time(Open), Symbol, Ticket, Type, Volume, Price(Open), SL, TP and Time(Closed), Price(Closed),... but cant select (open/closed)times from positions history directly (no partial order execution) aka it doesent matter if the order! history open time (row far-left) differs with the real server time execution (row after TP) by msec, because the trader can't change/manipulate the delay...so you must go through deals:out to get the OrderCloseTime, for me its cumbersome...
Fernando, ist there a way to get the OrderOpenTime and OrderCloseTime directly from the Positions History Tab?
Kind regards
where ?
thanks, at the same point, see post #1, code snippet #1
maybe i found a solution, if so, i'll keep you posted
Please note that Positions only exist while they are open. Once they close, they are gone, There is no historical Positions data. There is only history about Orders and Deals, not Positions.
You should not be having any issues there, because MQL4+ and MQL5 datetime structs are exactly the same.
As stated before, there is no Positions history, only Orders and Deals history.
Please note that Positions only exist while they are open. Once they close, they are gone, There is no historical Positions data. There is only history about Orders and Deals, not Positions.
You should not be having any issues there, because MQL4+ and MQL5 datetime structs are exactly the same.
As stated before, there is no Positions history, only Orders and Deals history.
Fernando, sorry, this make no sense, attached you can see if you select History tab and check Positions only, you see, 2 time rows, left the opentime, right the closedtime, and yes the data source maybe from deals, but it is nonsens to show "times" ONLY for display in History/Positions!
Its not a great deal to implement a basic "HistoryPositionsTotal" without a list of deals like "HistorySelectbyPosition", because it can be displayed (attached pic) and is used in Trade History Report too.
The Trade History Report shows the identical data for Positions (Open+CloseTime TradeServerTime) and Orders (Buy+Sell)and Deals(TradeServer In+Out)!
The History Positions Time row, left, is Deals:IN:OrderOpenTime! (TradeServerTime)
The History Positions Time row, right, is Deals:OUT:OrderCloseTime! (TradeServerTime)
The Trade History Report shows the required (Positions) data perfect..personal, i think 80% of traders are good with Positions Trade History Report only, 18% with Positions+Orders Trade History Report and 2% need the full History with Deals.
My EA consists 260 Sub Agents AA0-9 till AZ0-9, each acts in round robin fashion using quantitative technologies...therfor acting with history deals ist not an option because, 10 symbols, 10 orders per symbol and day, 260 order management agents = 52.000 lines in deals in ONE day!
And again, why it is NOT possible to get the Positions History ONLY, like the Trade History Report? In Report and Terminal History are perfect displayed, but NOT usable in programming....makes no sense....
And date, datetime is in MQL4 weird too, comparing to fortran, cobol, and so on
Kind regards
Did you see any MQL5 function for Position History data? No, there is none!
It does make sense once you stop thinking in MQL4 and start thinking in MQL5. You did not do as I suggested. You did not read "Orders, Positions and Deals in MetaTrader 5". Please read it fully before continuing.
What you have is Order History and Deal History, and both of which have a property called "Position ID" which can be used to build up the information about the Positions ...
Did you not state that you have also programmed in "C"?
MQL4/5 has it's roots in "C" and "C++", so the datetime is from there.
Did you not state that you have also programmed in "C"?
MQL4/5 has it's roots in "C" and "C++", so the datetime is from there.
correct, but MT4/5 uses it own scripting struct notations...so, it is likewise but not time.h library .....
Did you see any MQL5 function for Position History data? No, there is none!
It does make sense once you stop thinking in MQL4 and start thinking in MQL5. You did not do as I suggested. You did not read "Orders, Positions and Deals in MetaTrader 5". Please read it fully before continuing.
What you have is Order History and Deal History, and both of which have a property called "Position ID" which can be used to build up the information about the Positions ...
Fernando thank you again!
Decision is made after i found tester have no Positions too (https://www.mql5.com/en/forum/433144#comment_42221461), it is not a must have at this time because i use live data, but maybe in the future.
And yes there ist no Positions History BUT Trade History Report has the code to get all the data needed from Orders & Deals to generate the Trade History Report and display Positions in History tab has it too.
Attached a pic from my EA, with 10 order agents working seriell mode (one VPS) = if they are distributed to 10 VPS, they work in parallel mode
So, with maximum configuration of 260 order management agents, they producing 52k lines in the Deals History per day!
Therfor, i'll stick with MT4, till Metaquotes will implement Positions* in full AND fix high cpu usage on graphical elements also.
Fernando, thank you for our discussion, it was a pleasure for me!
Its not a great deal to implement a basic "HistoryPositionsTotal" without a list of deals like "HistorySelectbyPosition", because it can be displayed (attached pic) and is used in Trade History Report too.
From here.
very nice fxsaber! thank you, but i cant read russian, maybe there is a english, geman, spanish, french version?
if not i'll us google translation or AI :)
EDIT: неопубликованный функционал MQL5-языка
really? positions* are coded in MT5, but not public?