
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
Hello.
Could you please tell me how to set a vertical line on a chart at a certain point?
Thank you.
MQL5 Reference / Graphic Objects
MQL5 Reference / Graphic Objects / ObjectCreate
MQL5Reference / Standard constants, enumerations and structures / Object constants / Object types
MQL5Reference / Graphic Objects / ObjectSetInteger
And so on.
You create an object and then set its properties.
It goes something like this:
MQL5 Reference Guide / Graphic Objects
MQL5 Reference / Graphic Objects / ObjectCreate
MQL5Reference / Standard constants, enumerations and structures / Object constants / Object types
MQL5Reference / Graphic Objects / ObjectSetInteger
And so on.
Create an object, then set its properties.
Somewhere so:
.... and that's it - it's not clear.... method GetData returns either -1 or >= 0 - (and I need the opening price of bar 5)
And what did you want to get? Look at the documentation:"Return value: >=0 - if successful, -1 - if failed to get data".
If "we need the value of bar opening price #5", then this value should be searched for in the "array for placing data", i.e. in the Open[] array in your case.
...Read Handbook
Alfff:
If the object named name in the chid graph does not already exist, then ...
If it already exists, we simply skip creating the object and go straight to modifying the settings.
If the object named name in the chid graph does not already exist, then ...
If it already exists, we just skip creating the object and go straight to modifying the settings.
Small note: "If object is not found, function returns negative number". Apparently, it doesn't necessarily return "-1".
As I say, "...Read the Reference" :)
A small note: "If no object is found, the function returns a negative number". Apparently, it doesn't necessarily return "-1".
As I say, "...Read the Reference" :)
It's probably better to put
Although it's always worked.
What did you want to get? See the documentation:"Return value: >=0 - if successful, -1 - if failed to get data".
If you "need value of bar opening price #5", then you should look for this value in "array to place data", i.e. in Open[] array in your case.
...Read Reference
Thank you for your help. I will definitely read it...
Thank you for your help. I'll be sure to read it...
Question 1. Where to look for (with so much effort) open price data (in what place of the Open[] array )...????
Question 2. For the timeframe D1 we should declare another array and create our own instance of the class (or we can do with one)...????
Question 1: ALL Standard Library classes that provide access to indicator and timeseries data require "refreshing" them (the data) before using them.
Write it this way (in a simplified version):
Question 2. the other one.