Last number is the shift. Shift of zero is the current bar, shift of one is one bar ago (the last completed bar.) You want a shift of five. Negative five would be in the future.
So any time I want to see the price of a certain bar I should use the shift but positive number to go back (sorry negative numbers from CTL!). Thanks
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If I am interested in finding the price of a moving average -5 bars back instead of the current bar would I change the shift number to do it like below?
MA1 = iMA(NULL,0,MA_Period,0,MODE_SMA,PRICE_CLOSE,-5);
Ultimately I'm trying to find the price space between two points on a moving average so I need to designate which bars I'm trying to get the price of the moving average.
Thanks