Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Need Help Programming Custom Indicator from TS to NT

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

    Need Help Programming Custom Indicator from TS to NT

    Hello,

    I'm a new NinjaTrader user and am trying to convert some indicators I wrote using EasyLanguage in Tradestation into NT. I've been successful at a few, but this one, I cannot figure out. I have no experience in C#, just read the help files on NT website. It seems to not be possible to reference previous bar values of the double type variable, which I was able to do in TS.

    If anyone can help me with the ninjascript code for the following, I would greatly appreciate it.

    ========================================

    Inputs: Price(Close), Length(14), Displace(0), ROCAve1(4), ROCAve2(6);

    Value1 = LinearRegValueFC(Price, Length, 0);
    Value2 = Value1[0] - Value1[1];
    Value3 = XAverage(Value2, ROCAve1);
    Value4 = Value3[0] - Value3[1];
    Value5 = XAverage(Value2, ROCAve2);
    Value6 = Value5[0] - Value5[1];

    Plot1(Value2, "LinRegROC");
    Plot2(Value3, "LRegROCAve1");
    Plot3(Value5, "LRegROCAve2");
    Plot4(0, "Zero");

    #2
    You would need to use a "DataSeries" variable. Please check out e.g. the ADX indicator implementation. It's using several of these variables ("dmPlus", "dmMinus" ...).

    Comment


      #3
      Also: pls see here http://www.ninjatrader-support.com/H...taSeriesObject

      Comment


        #4
        Thank you very much. With the references you gave me, I was able to program this indicator using Ninjascript.

        Comment


          #5
          Excellent! Glad you were able to get through it.

          Just as an FYI, in TS, they hide what you just went through underneath the user programming layer. Although this can be easier for new C# programmers, it does come at the expense of performance. Although we provide a lot of convenience methods and properties, we stay true to the language and provide the raw programming capability that C# and the .NET framework provide.
          RayNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CortexZenUSA, Today, 12:53 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by CortexZenUSA, Today, 12:46 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by usazencortex, Today, 12:43 AM
          0 responses
          5 views
          0 likes
          Last Post usazencortex  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,265 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          11 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X