Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1533
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
Can you tell me how to understand the documentation in general? I'm really worried that in the examples of even a simple graphical object like text, they throw in your face a sample with a bunch of code and nowhere do they write which parameters are mandatory and which are not. So in order to just write some text or set a trend or even understand the buffers for an indicator you don't understand what minimum parameters should be entered and you have to copy out and paste your code
Hello, the required parameters for the text are window index, coordinate reference and the text itself, the others are optional.
You need to keep in mind that there are two types of objects, OBJ_LABEL and OBJ_TEXT. The first object is bound to window pixels and the second to time and price on the chart.
Let's say we need a text label linked to pixels, then do this:
this is almost minimal code that draws the text label
the same for the OBJ_TEXT object, but you also need to specify the price and time properties:
text_corner should be one of the constant values:
ID
Description
CORNER_LEFT_UPPER
Centre of coordinates in the left top corner of the chart
CORNER_LEFT_LOWER
Centre of coordinates in the lower left corner of the chart
CORNER_RIGHT_LOWER
Centre of coordinates in the lower right corner of the chart
CORNER_RIGHT_UPPER
Centre of coordinates in the upper right corner of the chart
more details here: https://www.mql5.com/ru/docs/constants/objectconstants/enum_basecorner#enum_base_corner
text_corner should be one of the constant values:
Identifier
Description
ANCHOR_LEFT_UPPER
Anchor point in the upper left corner
ANCHOR_LEFT
Anchor point to the left in the centre
ANCHOR_LEFT_LOWER
Anchor point at the lower left corner
ANCHOR_LOWER
Anchor point below centre
ANCHOR_RIGHT_LOWER
Anchor point at the lower right corner
ANCHOR_RIGHT
Anchor point to the right in the centre
ANCHOR_RIGHT_UPPER
Anchor point at the upper right corner
ANCHOR_UPPER
Anchor point at the upper centre
ANCHOR_CENTER
Anchor point exactly in the centre of the object
more details here:https://www.mql5.com/ru/docs/constants/objectconstants/enum_basecorner
you can also connect the standard library #include <ChartObjects\ChartObject.mqh> and use its classes, but this only complicates your life in my opinion
Greetings, mandatory parameters for text are window index, coordinate binding and text itself, others are optional.
Keep in mind that there are two types of objects: OBJ_LABEL and OBJ_TEXT. The first one is bound to window pixels and the second one to time and price on the chart.
Let's say we need a text label linked to pixels, then do this:
this is almost minimal code that draws the text label
the same for OBJ_TEXT object, but you only need to set price and time properties:
God bless you )It's not just the text but many things, even the indicator buffers. What's in the cart removed?)
God bless you )It's not just the text, it's many things, even the indicator buffers. Why are you deleted from the trolley?)
I deleted from the trolley as usual because I was paranoid and the Chexists didn't find me out 😀 I have no idea what to do with it.
And the right option is, well, very simple...
And what is it? Why don't you write it down?
Hi all, I have inserted in one EA "starhour and stophour" to open orders at a certain time, but I have not considered that an order which was open for example at 22:00 will not close in stophour(23:00)
put "starhour and stophour" only on open orders
put "starhour and stophour" only on opening orders
You cannot trade after stophour
The global parameters are set
And in OnTick
That's the problem, it only opens and closes starthour->stophour orders
That's the problem, it only opens and closes starthour->stophour orders
something like this
something like this
This is how the order closes