• 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

  • mate41
    started a topic TSI with signalline

    TSI with signalline

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

  • mate41
    replied
    Many Thanks Cody, didn't find and understand that little correction. Problem solved.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    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

    Leave a comment:


  • mate41
    replied
    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.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    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?

    Leave a comment:


  • mate41
    replied
    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 !!

    }

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    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

    Leave a comment:


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

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by rickyblah12, Yesterday, 08:17 PM
1 response
11 views
0 likes
Last Post NinjaTrader_PaulH  
Started by Johnny Santiago, Today, 04:50 AM
0 responses
4 views
0 likes
Last Post Johnny Santiago  
Started by jamarc, Today, 02:30 AM
0 responses
4 views
0 likes
Last Post jamarc
by jamarc
 
Started by mrlucky1x, Yesterday, 08:07 PM
0 responses
4 views
0 likes
Last Post mrlucky1x  
Started by uday12, Yesterday, 07:21 PM
0 responses
5 views
0 likes
Last Post uday12
by uday12
 
Working...
X