The below is a sample script which debug print ATRP at the last day.
The problem I'm seeing is an inconsistency in the result with scale and data range combination.
I ran this script with MSFT symbol and got the following results.
Scale: Daily
1 Months Range: 3/22/2010, 1.27852310270616
2 Months Range: 3/22/2010, 1.29262271192594
3 Months Range: 3/22/2010, 1.29281744587297
Scale: 1 Minute
1 Months Range: 3/23/2010, 1.27226829264635
2 Months Range: 3/23/2010, 1.28339805116751
3 Months Range: 3/23/2010, 1.28355290943638
The data range is much longer than 5 day periods that is specified to the data series.
Also the script always runs in daily scale regardless of the scale specified in the data panel.
Why these results are different and these are expected?
CODE:
Please log in to see this code.