Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

walkforward indicator

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

    walkforward indicator

    I've created a family of indicators that I'd like to make adaptive.

    the basics of the indicator is as follows:

    parameters (MA length, Compensation, and Prediction Plength

    take a MA(the period is fixed) of the input,(1)
    take the difference of the Output and the input[Plength] (i'll call it the error term)
    take the MA of the error(call it avgerr) (2)

    set the output to the original MA (1) + Compensation*avgerr (2)

    the above i have working

    what i want to do is to create an indicator which adjusts the Compensation:

    basically the initial compensation would be provided as a parameter, and later it would be adjusted to reduce the error term. (kinda like the walkforward test)

    #2
    mike82, you would need to create differrent indicator results using different compensation factors as input and then track the resulting errors against your target. Then create the final indicator by using the lowest error generating parameter set for the given bar range.

    Comment


      #3
      would it be possible to call an indicator that calculated the error term

      then in the onbarupdate method to use a loop to sweep the comp term of the error indicator, while searching for the lowest error value?

      my main worry is that this will blow up in the ram and crash nt (i've done this before in the past in nt6.5 (i'm using nt7b6 btw) )

      is there a way to ensure that the indicators called in the loop are disposed of to prevent an overload of ram?

      I'd like to follow the gradient of the error-vs-comp term to find the minimum Error (rather than to brute force sweep across a wide set of parameters)


      ....OR

      do i simply have to call a grid of indicators and search for the lowest value among them
      Last edited by mike82; 01-25-2010, 09:36 PM.

      Comment


        #4
        You could work with Dispose() to clean up used resources explicitly in your code - http://www.ninjatrader-support.com/H...6/Dispose.html

        I'd call a grid of indicators and use the lowest error generating one on the fly, the indicator instances would be cached then by NT.

        Comment


          #5
          I've gotten it to work using the search technique but it's very slow and eats RAM like there's no tomorrow.

          another question:
          Is there a way when calling an indicator once (to get a value computed) is there a way to get it to work on a more recent subset of the input dataseries? (this should really speedup the search, and possibly cut down on ram usage)

          Comment


            #6
            Unfortunately not supported Mike, NinjaTrader 7 will support smaller default dataseries (256 objects) per default and then you could swith to NT 6.5's 'Infinite' as needed.

            A workaround would be completely custom coding it using C# Arrays.

            Comment


              #7
              I'm using the beta. (can you point me to any documentation? if it exists)

              a work around i thought of is to modify the error indicator to do nothing until it gets close to the more recent data.


              basically i'd pass the parameters integer LookBack=(how many of the recent bars i want to use to do the error calculation) and CB = CurrentBar.

              in the error indicator i'd use the code:
              if (CurrentBar<CB-LookBack) return; so that the really old bars are ignored.

              would something like that work?

              Thanks for your help,

              Mike

              Comment


                #8
                Mike, for the beta the documentation is 'work in progress', most important would be reviewing the code breaking changes and related docs -

                Contains critical information including but not limited to migration, installation, connections and changes.


                I think your approach has merit, just calculate the number of bars needed to trade with it.

                Comment


                  #9
                  windowing the indicator did nothing but after looking up the documentation in the Dispose() method I solved it by wrapping the call to the indicator in an using scope like this

                  Code:
                  using (ErrorIndicatorClass newerrcalc=(ErrorIndicatorClass(params))
                  {
                  errornew=newerrcalc[0];
                  }
                  thanks for the help Bertrand!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  597 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  343 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  556 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  555 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X