Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Transferring a Strategy from 6.5 to 7

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

    Transferring a Strategy from 6.5 to 7

    Hello

    I've been using a custom strategy in NT 6.5 for quite some time and never had a problem.
    When I transferred it to NT 7, (following all the guidelines published here) I could compile it without a problem but when I applied it to a chart the indicator panel stayed empty (should have displayed a line) and the labels that should be drawn next to the candles didn't show either.

    What can I do about that?

    Thanks

    #2
    Are you sure you enabled the strategy? Disabled would show a little 'D' next to the strategy name in your chart...just go for example to the strategies tab and click on the 'Enable' checkmark to start it...

    Comment


      #3
      I'm sorry I meant to say a custom indicator, not a strategy...

      The Log says: Failed to call method "Initialize" for indicator XYZ: "BarsInProgress" property can not be accessed from within "Initialize" method.
      Last edited by laocoon; 10-27-2009, 04:36 AM.

      Comment


        #4
        Thanks laocoon, certain properties can't be accessed in the Initialize(), could you please post your Initialize() contents so we can take a look?

        Comment


          #5
          Sure, here you go:

          Thanks!

          protected override void Initialize()
          {
          //canvas = new Canvas (ChartControl, Bars, TickSize);


          Add(new Plot(new Pen(Color.Red, 3), PlotStyle.Line, "ERGDN")); // Values[0] Puts a Red line over the blue ERG line only when it is going down
          Add(new Plot(new Pen(Color.Blue, 3), PlotStyle.Line, "ERG")); // Values[1] ERG Blue line
          Add(new Plot(new Pen(Color.Transparent, 2), PlotStyle.Line, "HIST")); // Values[2] HIST line, default transparent.
          Add(new Plot(new Pen(Color.Lime, 4), PlotStyle.Bar, "wERGhistRising")); // Values[3] HIST bars rising
          Add(new Plot(new Pen(Color.Black, 4), PlotStyle.Bar, "wERGhistFalling"));// Values[4] HIST bars falling

          Add(new Line(new Pen(Color.DarkGray, 1), 0, "ZERO"));
          Lines[0].Pen.DashStyle = DashStyle.Dot;
          Add(new Line(new Pen(Color.Red, 2), _thresholdERG, "PLUS10")); // References +10,-10, ZERO
          Add(new Line(new Pen(Color.Red, 2), -_thresholdERG, "MINUS10"));


          Overlay = false;
          PriceTypeSupported = false;

          // Init user data series
          mtm = new DataSeries(this); // Momentum = C - C1
          absmtm = new DataSeries(this); wTSI = new DataSeries(this); wERGhist = new DataSeries(this);
          wERG = new DataSeries(this); dirERG = new IntSeries(this); // just tracks color changes 1=up, -1=down, 0=invalid
          dirHIST = new IntSeries(this); // just tracks color changes 1=up, -1=down, 0=invalid
          this.BarsRequired = 1;

          if (cType==ERG1Type.Trending) cTrend = true;
          else cTrend = false;
          if (cTrend) { m1 = 1; m2 = 1; m3 = 72; } // set modifiers for longer chart
          else { m1 = 7; m2 = 0.5; m3 = 0; } // set modifiers for faster Trade labeling chart
          bool cTrade = !cTrend; // simply readability to have the inverse of cTrend

          minBreach = _thresholdBreach * TickSize;
          bcTrans = Math.Max((bcAlpha * 10/255) + 3, 10);
          }
          // end of Initialize method

          Comment


            #6
            You likely tried to access the "TickSize" property in your Initialize() method which is not supported.

            Comment


              #7
              I'm not sure I'm following you here. The only thing I found regarding Tick Sizes is this:

              TickSize is no longer reflective of splits. For splits use this:
              double tickSizeSplitAdjusted = TickSize /
              Bars.Instrument.MasterInstrument.Splits.GetSplitFa ctor(Bars.GetSessionDate(Ti
              me[0]));

              Unfortunately I don't know how this relates to the problem at hand.

              Thanks
              Last edited by laocoon; 10-27-2009, 07:20 AM.

              Comment


                #8
                >> minBreach = _thresholdBreach * TickSize;

                This is a limitation. You can't access TickSize in Initialize(). We will clarify that in one of the next version of our docs.

                Comment


                  #9
                  OK, is there a workaround I can use in the meantime?

                  Thanks

                  Comment


                    #10
                    The same limitation was there with strategies in NT6.5. One option would be putting the offending code in OnBarUpdate.

                    Comment


                      #11
                      I'm sorry but I don't follow you again:

                      -the indicator is working fine in NT 6.5
                      -the TickSize command is already in the OnBarUpdate part of the code

                      Thanks again.

                      Comment


                        #12
                        This is a new limitation in indicators which already was there with strategies on NT6.5. Please move the offending code to OnBarUpdate and the issue will be resolved.

                        Comment


                          #13
                          Got it, it's working, thank you very much!

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          602 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          347 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
                          560 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          559 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X