Hi, I want to create an indicator that draws Open price levels from higher TF given in parameter. For example: I want to have open price levels on my M1 chart from H1 TF, so I add an indicator with "60" parameter (period 60 = h1).
I wrote this code:
However it doesn't work as it supposed to.
This is how it works now:
http://i53.tinypic.com/rrvbx5.jpg
http://i56.tinypic.com/15zkz1d.jpg
As you can see the line of an indicator just draws open prices from H1 on M1 chart but not in a proper way. This is how it should look like:
http://i55.tinypic.com/ohn6dc.jpg
So for a H1 parameter each hour a new level for current open price.
How to code it this way? Please post some example lines if possible.
Thanks.
I wrote this code:
Inserted Code
#property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 White extern int tf; double Buf_0[]; int init() { SetIndexBuffer(0, Buf_0); SetIndexStyle(0, 0, 1, 2); return(0); } int deinit() { return(0); } int start() { int i, counted_bars=IndicatorCounted(); i = Bars - counted_bars - 1; while (i >= 0) { Buf_0[i] = iOpen(NULL, tf, i); i--; } return(0); }
However it doesn't work as it supposed to.
This is how it works now:
http://i53.tinypic.com/rrvbx5.jpg
http://i56.tinypic.com/15zkz1d.jpg
As you can see the line of an indicator just draws open prices from H1 on M1 chart but not in a proper way. This is how it should look like:
http://i55.tinypic.com/ohn6dc.jpg
So for a H1 parameter each hour a new level for current open price.
How to code it this way? Please post some example lines if possible.
Thanks.