Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1960
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
As explained by Alain, there is no such function. You have to code it yourself.
MQL is a compiled language, not an interpreted language. Such functionality does not exist.
Study interpreted languages to see how they have accomplished that. For example, study how the eval() function is implemented in JavaScript or Python.
However, first consider if you really need it. Maybe you are making your problem worse by using an incorrect approach.
Reconsider your true objective (which you have not described) and whether it cannot be solved in a much simpler way.
I am creating an EA based on a custom indicator that uses buy and sell buffers ,
I added if (i>0) to the below code to make the arrow appear only when the candle is closed. (without it the arrows keep appearing and disappearing which affects how trades are opened)
Now my issue is, when I add if (i>0) the EA based on this indicator does not open trades, but when i remove if (i>0) the EA runs but its not accurate since the arrows appear and disappear.
any help will be appreciated.
if (i>0)
Buffer1[i] = Close[i]; //Set indicator value at Candlestick Open
if(i == 1 && Time[1] != time_alert) myAlert("indicator", "Buy"); //Alert on next bar open
time_alert = Time[1];
George Kariuki #:
I added if (i>0) to the below code to make the arrow appear only when the candle is closed. (without it the arrows keep appearing and disappearing which affects how trades are opened)
Now my issue is, when I add if (i>0) the EA based on this indicator does not open trades, but when i remove if (i>0) the EA runs but its not accurate since the arrows appear and disappear.
@Artyom Trishkin
Hi everyone. I want to draw short horizontal lines for high and lows when some conditions met. And after some time when conditions are met again I want to draw another horizontal lines high/low, but don't delete previous lines.
I used drawing trendline function from here, cause I have anchor points and I want those lines to be short. After testing my EA, I see it draws horizontal lines only first time, second time when conditions are met, it doesn't draw.
I attached picture how I want it to look like. But as you can see from picture, only first lines are drawn.
If someone knows how to do it, please help. Much appreciated
My EA is working the way I want it to be, except drawing these lines. I want to visualize it, so I can analyze previous trades
I searched answer in different forums, but couldn't find it. That's why I am writing on this forum. Thank you!
Then give each set of graphical objects a different and unique name. If you always name them "High" (or "Low") then you will only have one of them.
Give them names like "High1", "High2", etc., or give them names with which you can manage them more easily.
For example including the start date/time or something meaningful which allows you to manage the various objects more easily.
Then give each set of graphical objects a different and unique name. If you always name them "High" (or "Low") then you will only have one of them.
Give them names like "High1", "High2", etc., or give them names with which you can manage them more easily.
For example including the start date/time or something meaningful which allows you to manage the various objects more easily.