• 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 xsgex, Yesterday, 09:46 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post xsgex
                  by xsgex
                   
                  Started by Steve L, Yesterday, 09:36 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Steve L
                  by Steve L
                   
                  Started by krugman25, Yesterday, 09:34 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post krugman25  
                  Started by indy73, Yesterday, 04:42 PM
                  0 responses
                  15 views
                  0 likes
                  Last Post indy73
                  by indy73
                   
                  Started by Italianforex, Yesterday, 06:20 AM
                  2 responses
                  13 views
                  0 likes
                  Last Post gplatis
                  by gplatis
                   
                  Working...
                  X