Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show indicator on strategy

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

    Show indicator on strategy

    Hi

    On my strategy I'm using custom indicators. However those indicators are not shown on the chart.
    Is there a way to make them show? (besides placing them manually)

    10x

    #2
    Yes kiss987, your strategy script could Add() them as well for visualization as shown in our tip here - http://www.ninjatrader.com/support/f...ead.php?t=3228

    Comment


      #3
      Thank you for your reply. I have another question which might be connected to your answer.

      On my custom indicator i expose public methods and members. Their values are calculated on the indicator's OnBarUpdate method and their values can be changed on each tick. (The indicator's data series are not that important).
      From my strategy's OnBarUpdate I want to access those methods and members AFTER they have been calculated on the current tick. My indicator always receives same values on his constructor's parameters.

      What is the best way to do so? Add the indicator on the strategy Initialize? Use the Update Method on the strategy's OnBarUpdate?
      Can you please please add a short code sample assuming my indicator looks like that:

      MyInd(p1, p2);
      double d1 = MyInd.MyMember;
      double d2 = MyInd.MyMethod();

      Comment


        #4
        You would need to call Update() before returning the exposed variable like shown here - http://www.ninjatrader.com/support/f...ead.php?t=4991

        For a series this would not be needed.

        Comment


          #5
          Is this the way to do so:

          MyInd _MyInd;

          protected override void Initialize()
          {
          _MyInd = MyInd(p1, p2);
          }

          protected override void OnOrderUpdate(IOrder order)
          {
          _MyInd.Update();
          double d1 = MyInd.MyMember;
          double d2 = MyInd.MyMethod();
          }

          Comment


            #6
            Originally posted by kiss987 View Post
            Is this the way to do so:

            MyInd _MyInd;

            protected override void Initialize()
            {
            _MyInd = MyInd(p1, p2);
            }

            protected override void OnOrderUpdate(IOrder order)
            {
            _MyInd.Update();
            double d1 = MyInd.MyMember;
            double d2 = MyInd.MyMethod();
            }
            The better way may be to include the Update(); as part of the getter for the variables for the indicator that you are calling. That ensures that the Update() is specific to the variable that you are accessing.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X