RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



cannot get "lookback" for TSF Expand / Collapse
Message
Posted 7/4/2008 12:15:38 Post #6091
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
I created a "detrended price ocillator" and used it for input to a "times series forcast".

It shows very nicely on the chart but when I try getting the previous value using the "lookback"

all I get is NAN...

Walt

>> I attached a small project to demonstrate...

  Post Attachments 
dpo.zip (16 views, 7.94 KB)

Posted 7/4/2008 17:34:50 Post #6092
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
It looks like your try block is waiting for the 101st bar before it executes, was that intended? If so, do you have enough history available?. Also, Current is the same thing as LookBack(0) so "if(dpoTsf.Current < dpoTsf.LookBack(0))" will always be false.

HTH,
Mark
Posted 7/4/2008 19:09:43 Post #6093
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
thanks mark,

the 100 bars wait was intended since I suspect it requires quite a few bars to calc...

>> The lookback(0) was a translation mistake as I usually code in VB... it was supposed to be lookback(1)...

In any case, I think the issue is with the DPO, since it only returns NAN in the code...

Walt

Posted 7/6/2008 14:47:46 Post #6097
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
The DPO is calculated as the Close – (the SMA from ((n / 2) + 1) days in the FUTURE).  Since RightEdge doesn't allow indicators to actually look into the future, the most recent 11 values of a 20-period DPO will always be NaN.

In short, I would think twice about using the DPO.

Daniel

Posted 7/6/2008 17:08:36 Post #6098
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Thanks Daniel,

Since I did know <<RightEdge doesn't allow indicators to actually look into the future>> (which is great)... I did not think that it would let me use indicators that do.

Can you mark or list the indicators that use future bars so I can insure I do not use them;

This one indicator, DPO,  cost me a  lot of time trying to integrate it into my strategy... Had I known it used future bars, iwould not have tried to get it to work...

Thanks!

Walt

BTW; the "zig Zag" uses future bars and does not show the graph on the most recent bars; If all the future indicators behaved this way

that would be a good visual cue that it uses future bars...

Posted 7/6/2008 23:22:28 Post #6099
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
All future indicators do work that way.  If you look at the most recent bars for you will see that they don't have any value for the DPO.

In code, you can look at the OldValuesChange property of an ISeries to determine whether values for previous bars can change.  If this is true then the indicator is probably looking into the future in some way.  Note that the indicator is responsible for returning this value so an incorrectly written indicator could return the wrong result.  The built-in indicators that return true for this property are:

Detrended Price Oscillator (DPO)
Linear Regression Trendline
Tirone Levels (Upper, Lower, and Center)
Zig Zag

Thanks,
Daniel

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 1:38am

2005-2007 © RightEdge Systems