Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1572

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
I have several positions of the same type at the same time (either long or short), their number is either iq1 or iq2. I get the error "'PositionGetInteger' - none of the overloads can be applied to the function"? Basically, I need to correctly define the type of any position at the moment and insert it into the condition
Can you tell me in words what happens when this code is executed?
The clever engine of the forum has highlighted PositionGetInteger() in the description of which there is an answer to your question.
The function returns the requested property of the open position, previously selected using the....................................... function.
Before "before" you should select this order, then determine its type and only then...................
Can you comment on what is written in these lines?
MqlDateTime dtLast, dtCurr; datetime TimeCurr = TimeCurrent(dtCurr); datetime TimeDay = iTime(_Symbol, PERIOD_D1, 0); int Shift = iBarShift(_Symbol, PERIOD_M1, TimeDay); datetime TimeLast = iTime(_Symbol, PERIOD_M1, Shift); TimeToStruct(TimeLast, dtLast); if(dtCurr.hour * 60 + dtCurr.min >= dtLast.hour * 60 + dtLast.min) Print(" TimeCurrent", TimeCurrent(), "; TimeLast ", TimeLast);
Just got to the programme.
It works, but unstable, the problem with access to time different from the time on which the programme is installed.
I will try to replace it with SymbolInfoInteger(Sym_arr[i],SYMBOL_TIME) and compare it with the current time + 5 minutes.
Thanks for your time!
How to find out the value of an array from a structure?
How to find out the value of an array from a structure?
Why aren't there arrays in the structure?
You need to hold your finger for a couple of seconds on an empty field. A vertical dotted line will appear on the current bar. Move the chart to the left as needed. Single click on the empty field to reset the vertical line. The indentation will remain
How to find out the value of an array from a structure?
write your own int ArrayMininum(aIND &[])
or even
template <typename T> int ArrayMiniumu(T const&[],int (*Comapartor)(const T&,const T&))
because only the author of the code knows how exactly arbitrary structures should be compared