I tried to create a trendline in the indicator window and its just only a horizontal line.
So I'm trying to make a bullish/bearish divergence here but halfway through, the line on the MACD is just a horizontal.
Would it be possible to make it the same as the trendline in the chart as in the attached picture?
use OBJ_TREND
https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_trend
- www.mql5.com
use OBJ_TREND
https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_trend
Oh I forgot to provide the code, well I actually did use OBJ_TREND tho I'll try to test again..
ObjectCreate( _Symbol, "trendline", OBJ_TREND, ChartWindowFind(0,"MACD(12,26,9)"), PriceInfo[0].time, myMACD(1,0), PriceInfo[1].time, myMACD(2,1) ); ObjectSetInteger(0,"trendline",OBJPROP_COLOR,Green); ObjectSetInteger(0,"trendline",OBJPROP_STYLE,STYLE_SOLID); ObjectSetInteger(0,"trendline",OBJPROP_WIDTH,1);
What if
ChartWindowFind(0,"MACD(12,26,9)"),fails? It would be better set in OnInit() and use shortname, see here: https://www.mql5.com/en/docs/chart_operations/chartwindowfind
- www.mql5.com
So I'm trying to make a bullish/bearish divergence here but halfway through, the line on the MACD is just a horizontal.
Would it be possible to make it the same as the trendline in the chart as in the attached picture?