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
Could you give me some code for an EA to close a position after 5-6 hours? Or give me a link.
If you are interested, try it yourself. First, using the PositionSelect() function , check for an open position. If it is successful, find out the time of opening a position using PositionGetInteger(POSITION_TIME) and check your condition of 5-6 hours. When it is time to close the position, you find out the type of position (ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE) and its volume PositionGetDouble(POSITION_VOLUME) . Then you set an opposite order with the same volume. You can see an example of the position closing method at MQL5\Include\Trade\Trade .mqh\PositionClose(const string symbol,ulong deviation=ULONG_MAX).
Thank you, that seems to be what we need.
Not really.
To get the "mouse click" event, OnChartEvent() must be used, but it cannot be used in scripts, what should I do? So there is no universal function?
Not really.
To get the "mouse click" event, OnChartEvent() must be used, but it cannot be used in scripts, what should I do? So there is no universal function?
Then use GetKeyState + GetPosition + known coordinates of graphical objects.
VinApi?
That's it, I've lost my desire to make a universal function for browsing and selecting a file from a list (some kind of mini-file manager). :(
WINAPI?
That's it, I've lost the desire to make a universal function for browsing and selecting a file from a list (some kind of mini-file manager). :(
why the script then?
See an example of method for closing a position at MQL5\Include\Trade\Trade.mqh\PositionClose(const string symbol,ulong deviation=ULONG_MAX).
Thank you.
But I'm not yet able to understand classes, although what I have is usually due to the fact that I've seen somewhere and figured it out.
because he doesn't care if the ticks are ticking or not.
But with classes, I'm not yet getting the hang of it, although what I do get is usually at the expense of seeing it somewhere and figuring it out.
Well, any class method is just plain code. Try parsing this code here:
so the expert doesn't care. why a script?