• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TSI with signalline

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

    TSI with signalline

    Hi,
    anybody could tell me how adding a signal line to the existing ninjatrader TSI ?
    BR

    #2
    Hello,
    You will need to make a copy of the TSI that you can edit first. You can do this by going to Tools >Edit NinjaScript > Indicator > TSI > press OK> Right Click> Select Save As.. and name your indicator.

    Then you can add a line within the Initialize() method. Please see the following link on how to add a line: http://ninjatrader.com/support/helpGuides/nt7/add.htm

    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Cody,
      i know that but what i mean is adding a trace-line together with the tsi-line, see screenshot.
      Attached Files

      Comment


        #4
        Hello,
        You would need to add a plot that is based off of the same calculations as the signal line that you are referring to.
        Please see the following link on plots: http://ninjatrader.com/support/helpGuides/nt7/plots.htm
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          VALUE problem ??
          protected override void OnBarUpdate()
          {
          if (CurrentBar == 0)
          {
          fastAbsEma.Set(0);
          fastEma.Set(0);
          slowAbsEma.Set(0);
          slowEma.Set(0);
          Value.Set(0);

          }
          else
          {

          double momentum = Input[0] - Input[1];
          slowEma.Set(momentum * (2.0 / (1 + Slow)) + (1 - (2.0 / (1 + Slow))) * slowEma[1]);
          fastEma.Set(slowEma[0] * (2.0 / (1 + Fast)) + (1 - (2.0 / (1 + Fast))) * fastEma[1]);
          slowAbsEma.Set(Math.Abs(momentum) * (2.0 / (1 + Slow)) + (1 - (2.0 / (1 + Slow)))* slowAbsEma[1]);
          fastAbsEma.Set(slowAbsEma[0] * (2.0 / (1 + Fast)) + (1 - (2.0 / (1 + Fast))) * fastAbsEma[1]);
          Value.Set(fastAbsEma[0] == 0 ? 0 : 100 * fastEma[0] / fastAbsEma[0]);
          // Value.Set(slowAbsEma[0] == 0 ? 0 : 100 * slowEma[0] / slowAbsEma[0]); // don't work !!

          }

          Comment


            #6
            Hello,
            Can you clarify if you are trying to set a separate Value data series when you are doing Value.Set a second time or are you seeing that specific Value.Set overload does not work?
            Cody B.NinjaTrader Customer Service

            Comment


              #7
              See variables & Initialize:

              Code:
              public class TSInew : Indicator
                  {
                      #region Variables
                      private int                    fast    = 3;
                      private int                    slow    = 14;
              
                      DataSeries                fastEma;
                      DataSeries                fastAbsEma;
                      DataSeries                slowEma;
                      DataSeries                slowAbsEma;
                      #endregion
              
                      /// <summary>
                      /// This method is used to configure the indicator and is called once before any bar data is loaded.
                      /// </summary>
                      protected override void Initialize()
                      {
                          Add(new Plot(Color.Green, "TSInew"));
                          Add(new Plot(Color.Red, "TSIsign"));
                          Add(new Line(System.Drawing.Color.DarkViolet, -50, "Lower"));
                          Add(new Line(System.Drawing.Color.DarkViolet, 50, "Upper"));
                          Add(new Line(System.Drawing.Color.Red, 0, "Zero"));
                          fastAbsEma    = new DataSeries(this);
                          fastEma        = new DataSeries(this);
                          slowAbsEma    = new DataSeries(this);
                          slowEma        = new DataSeries(this);
                      }
              I need the signal line (fast=3) with the TSI line.
              What i do, no luck.

              Comment


                #8
                Hello,
                If you are wanting to set the second plot you would need to use Values[1].Set(). Value.Set would take over the TSI plot.
                You will also need to do Values[1].Set(0) in the if(CurrenBar ==0) block.
                For more information on Values please see the following link: http://ninjatrader.com/support/helpG...nt7/values.htm
                Cody B.NinjaTrader Customer Service

                Comment


                  #9
                  Many Thanks Cody, didn't find and understand that little correction. Problem solved.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Abilene, Today, 01:27 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post Abilene
                  by Abilene
                   
                  Started by simjs, Yesterday, 08:11 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post simjs
                  by simjs
                   
                  Started by mrlucky1x, Yesterday, 06:01 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post mrlucky1x  
                  Started by dedouglas, Yesterday, 03:17 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by Jugado, Yesterday, 02:22 PM
                  2 responses
                  30 views
                  0 likes
                  Last Post Jugado
                  by Jugado
                   
                  Working...
                  X