
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 need help with ChartXYToTimePrice.
I want to step a horizontal line down a number of times from top to bottom of screen.
I made a function, but it does not work.
Please let me know if you have any insights as to where I went wrong (me knowing only old MQL4 and not new MQL4/MQL5, and this is first new MQL4 function I've tried to implement into my code).
Thanks in Advance!
Kindest regards,
Don
I haven't tested the code but I think that this will only create 1 line
You could name the line name+ (string) i
You also need to change the y value inside the loop
GumRai,
You are right that the code was producing just one line. I forgot to add number++ at end of for cycle. After doing that, it creates the correct number of objects on chart, even makes them the correct color and width. But they're 0 value. This leads back to ChartXYToTimePrice, which is not returning the correct value for price for horizontal line.
Thanks for your help! At least making progress :) Any more replies are welcome and desired.
Kindest regards,
Don
If I add:
Alert(price);
... right below ObjectCreate line of code, I get all 0 values for all objects, so again, function is not returning correct values each cycle.
i noticed that only if x >= 3 price returns something
maybe it's a bug maybe not i don't care
Thanks qjol, that worked!
Thanks again!
Kindest regards,
Don