Questions from Beginners MQL5 MT5 MetaTrader 5 - page 752
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
Excuse me for a very simple question, how do I close an open position? mql4 has the OrderClose() function, but how?
In mql5, you have to open an opposite position. It can be clearly seen in the tab of the terminal History. The easiest way is to use the CTrade class from the standard library.
Gentlemen, please tell me where the error is.
I am preparing an indicator to be called in the EA.
I want to send a buffer from the indicator.
The result is the int value attached to the bar.
The task is to pass a two-dimensional array from the indicator to an Expert Advisor, I can't figure out how to do it.
So I call it in the EA
Gentlemen, please tell me where the error is.
I am preparing an indicator to be called in the EA.
I want to send a buffer from the indicator.
The result is the int value bound to the bar.
The task is to pass a two-dimensional array from the indicator to an Expert Advisor, I can't figure out how to do it.
I call it in the EA
1. Remember that in the INDICATOR the default indicator buffer with index "0" corresponds to the leftmost bar on the chart.
2. The Expert Advisor has no "SetIndexBuffer" command.
3. iCustom is creating a custom indicator, not a buffer request (therefore, everything should be written explicitly, not ",0,1"). In your case, you can use this form
4. CopyBuffer seems to be written correctly.
5. Two-dimensional array can't be passed - make two array-indicator buffers.
1. Remember that in the INDICATOR, by default, the indicator buffer with index "0" corresponds to the leftmost bar on the chart.
2. There is no "SetIndexBuffer" command in the EA.
3. iCustom is creating a custom indicator, not a buffer request (therefore everything should be written explicitly, not ",0,1"). In your case, you can use this form
4. CopyBuffer seems to be written correctly.
5. You can't pass a two-dimensional array - make two array-indicator buffers.
I've looked throughIndicatorCreate(), could you please tell me how, otherwise it will take me weeks to figure it out, and I've got so little left to finish the thought block. I have to go to taiga soon to spend the summer with bees foraging, so I want to check the idea before departure, so I won't have any illusions.Thanks for the correction, but I do not understand, if I set explicitly to transfer arrays, how is it formalized? Where do I specify that I need to extract two arrays?
Is what I use in theINDICATOR_CALCULATIONS indicator correct?
Error 4002 is resolved.
only it is not clear where to write the array to be extracted?
Error 4002 is resolved.
only it is not clear where to write the array to be extracted?
The arrayper is declared in the EA, in the procedure in which you do the copying. It must be a dynamic array (declared as [] - without dimensionality).