Indicator code mod help
-
Hello
How can I change "comment" to "object" in code(last line) ? Then EA can read value(Channel size) ... Any ideas?ObjectCreate("MIDL", OBJ_TREND, 0, T2, (P2 + PP + Step*AB) / 2, T1, (P1 + PP) / 2); ObjectSet("MIDL", OBJPROP_COLOR, Lime); ObjectSet("MIDL", OBJPROP_WIDTH, 1); ObjectSet("MIDL", OBJPROP_STYLE, STYLE_DOT); Comment(" Channel size = ", DoubleToStr(MathAbs(PP - P1) / Point, 0), " Slope = ", DoubleToStr(-Step / Point, 2));
......
channel.jpg -
Comment() prints information in the upper left angle, but it doesn't have any options to make it look different. I don't recognize this code, you are probably trying to learn MQL4 or something. You can look at the documentation for ObjectCreate() - this function can draw many types of objects, including OBJ_LABEL - https://www.mql5.com/en/docs/constants/ ... /obj_label
Or, if you work with fxDreema, there is a block "Comment" that print the information using labels.
-
Well ,i need check "Channel size" value to this indicator. I do not want to open a trade if the value is less than 150(example) ,
flat channel. But value is "comment" , and fxdreema cant compare this ? ... Well , I'll be fine without this
-
Comment is just a function in MQL4/MQL5 to print some info on the chart. I don't even know if this text can be read from the chart, but it would be stupid anyway.
There is a way to work with indicators, and this way is by reading their buffers. Here is more:
https://fxdreema.com/help/-/you%20shoul ... indicators
https://fxdreema.com/help/-/working%20w ... indicatorsYour indicator has only 1 buffer and it's name in the code is ExtMapBuffer1. It gives you information about this thisng iprice, whatever it is. But the indicator is pretty simple, so I guess you can add another buffers to output more information.
-
OK , but this indicator has only one buffer. But i can read lines object value(by name) and compare.
as you see in the picture(Channel)

......
USDJPYM15.jpg -
OK , I found the modified version which contains 3 buffer.
So no longer need to bother with this question , thanks anyway.//channel distance of last/current bar ExtMapBuffer2[0]=NormalizeDouble(MathAbs(PP - P1)/Point,0); //angle of channel ExtMapBuffer3[0]=NormalizeDouble(-Step/Point, 2);