Please tell me about the trading function OrderOpenTime in the MQL4 Meta Editor
Please tell me about the trading function OrderOpenTime in the MQL4 Meta Editor
Loading saved threads...
kouzi2000 · External communityPost link
External question — Stack Overflow Stack Exchange
Author: kouzi2000
Original post: https://stackoverflow.com/questions/69662776
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I was writing code in MQL4 Meta Editor.
I wrote the code in such a way that it is possible to open both a buy and a sell position.
I tried to calculate the date and time of the candle that I entered with the trading function OrderOpenTime, but I don't know how to calculate the date and time of both buy and sell if the entry is both buy and sell.
I need your help.
Add the code I are currently writing
I'm sorry if my native language is Japanese and the English is strange.
for(int i = OrdersTotal() - 1; i >= 0; i--){
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;
if(OrderMagicNumber() != MagicNumber) continue;
if(OrderSymbol() != Symbol()) continue;
oder_shift = iBarShift(Symbol(),Period(),OrderOpenTime() , false );
}
Quote
Report
Post Reply
Checking account access…