Shift the whole price curve X bars left in chart

 

Hello,

I'm very new in programming MT4 custom indicators an that's the reason for my very basic question. How can I shift all values of the whole price curve in the chart (e.g close/high/low etc.) continuously "X" bars in the left direction of the chart? This shifted values are "basic" values for further calculations. So this should not only be a graphical solution in the chart! Is it possible to realize my requirement with MT4?

Thank you all for your help,

Frank.

 

You coud try SMA period 1 for each of the applied prices and shift however bars you want.

 

Hello Keith,

thank you for your quick response. I got a solution for my own. So, there is no further demand for answers, anymore.


Thank you all,

Frank.

 
Frank Simon:

Hello Keith,

thank you for your quick response. I got a solution for my own. So, there is no further demand for answers, anymore.


Thank you all,

Frank.

Please share your solution, a forum is not only to provide you something.
 
Alain Verleyen:
Please share your solution, a forum is not only to provide you something.

Hello Alain,

I'm aware that a forum in general is not only a one way street. But if no one asks for my solution, I assume that my "beginner" problem was very trivial and a posting of my solution is superfluous.

So, here we are:

shift price left in chart

 
  1. Don't post images of code, please use the SRC button !
  2. Your method can only shift the lines back in time. Use co[i]=Close[i] and use SetIndexShift to shift the displayed line backwards or forwards.
Reason: