How can I control when bands start on the chart?
Author: zozzy
Creation Date: 5/26/2010 9:12 PM
profile picture

zozzy

#1
Attached is a simple scrip using a single moving average. I've been adding to it--one thing at a time---trying to learn how each new thing works. My latest addition is upper and lower bands bracketing the SMA. The script compiles OK, but althought the SMA starts on the chart after x bars, the bands show up on the chart satrting at bar(0)and then jumps up to bracket the SMA at bar(x).

How can I have the bands start showing on the chart at bar(x)?

Thanks for the help.

CODE:
Please log in to see this code.


profile picture

Eugene

#2
Use the DataSeries.FirstValidValue property (QuickRef for more.) Example:
CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).