How can I connect close price of candles in mql5? - page 2

 
Alex trader:
I want to write the code to connect the close prices of candles to each other in an expert advisor file
 
MQL5 Book: Creating application programs / Creating custom indicators / Buffer and chart mapping rules
MQL5 Book: Creating application programs / Creating custom indicators / Buffer and chart mapping rules
  • www.mql5.com
When registering diagrams using PlotIndexSetInteger(i, PLOT_DRAW_TYPE, type) , each call sequentially assigns a certain number of buffers to the...
 
Alex trader #:

Thanks. Ok. But with this approach I can not plot close on the chart. So I think I have to use  iCustom function.

Hmm you can though. You use index 0 as the newest close, and index 1 as the second newest and so on.

However when it comes to drawing objects, that might be better for an indicator, unless you are literally only drawing one or two objects. 
If you want to connect every single close price, then you shouldn't draw objects but instead use buffers. In that case it might be good to look at my "volume weighted line chart" that I published in the code base for a code example