Announcement

Collapse
No announcement yet.

SuperTrend for alternate time frame

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SuperTrend for alternate time frame

    I have these lines of code in my strategy:

    xTrendD = efsExternal("SuperTrend.efs",3,.5,Color.green, Color.red,inv("D"));

    TrendD = xTrendD.getValue(-1);


    Note that I added the inv("D") parameter so that it would return values based upon daily bars and I use the values to determine daily trend.

    It seems to work except for one problem. My intraday chart goes back to 5/5/2008, but SuperTrend only starts to output values on 6/16/2011. As a simple test, I put a print statement in SuperTrend ( in the main function ) to print the date on every bar. It starts printing dates on 6/16/2011, which confirms the strange behavior. It seems to skip the first 3 years or so of data.

    My question is this: Should this method of implementing the SuperTrend indicator work as expected, or do I need to re-code it for multi time frame use ?
    Last edited by Pivot; 08-22-2012, 08:44 AM.

  • #2
    Pivot
    See the explanation and solution provided in this thread on what is essentially the same issue (in fact 6/16/2011 is 300 bars back on a daily chart)
    Alex


    Originally posted by Pivot View Post
    I have these lines of code in my strategy:

    xTrendD = efsExternal("SuperTrend.efs",3,.5,Color.green, Color.red,inv("D"));

    TrendD = xTrendD.getValue(-1);


    Note that I added the inv("D") parameter so that it would return values based upon daily bars and I use the values to determine daily trend.

    It seems to work except for one problem. My intraday chart goes back to 5/5/2008, but SuperTrend only starts to output values on 6/16/2011. As a simple test, I put a print statement in SuperTrend ( in the main function ) to print the date on every bar. It starts printing dates on 6/16/2011, which confirms the strange behavior. It seems to skip the first 3 years or so of data.

    My question is this: Should this method of implementing the SuperTrend indicator work as expected, or do I need to re-code it for multi time frame use ?

    Comment


    • #3
      Thanks. I had just spotted this myself and I am trying the solution. It should do the trick.

      P

      Comment


      • #4
        Can I make this use either regular session or 24hr session ?

        Comment

        Working...
        X