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

NT8 Input Parameters

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

    NT8 Input Parameters

    Hello,

    I'm wondering if it's possible to create a custom Input Parameter if one currently does not exit for an indicator in the Strategy Builder.

    Could I code that in?

    For example, for the 'N bars up' indicator, the 'Bars ago' field is not an 'Input series'; can I write NinjaScript code to make it an 'Input series' that is not hard coded so that I can change its value in the Strategy Analyzer?

    Screenshot of Conditions screen for 'N bars up' is attached.

    I found the following code in one of my .cs files for an Input that I created for 'Up Volume'; can I write such code to create an 'Input series' or 'Parameter'?

    #region Properties
    [NinjaScriptProperty]
    [Range(0.1, double.MaxValue)]
    [Display(Name="UpVolume1", Order=1, GroupName="Parameters")]
    public double UpVolume1
    { get; set; }


    #2
    Hello i2w8am9ii2,
    Thanks for your post.

    This would be possible if you unlocked your code, but will not be possible in the Strategy Builder. One thing you could do is go ahead and create an int input in the Strategy Builder and then unlock the code. At least that way the property for your BarsAgo value is already created.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      Thanks so much for your reply and for the info.

      I did unlock the code in this strategy, because I had to add some custom code to make it work as I wanted.

      So in that case, what would I need to change in the code below if I wanted to add an 'Input series' or 'Parameter' to the BarsAgo value?

      I searched through the Help Guides documentation for BarsAgo but only found a startBarsAgo and an endBarsAgo

      #region Properties
      [NinjaScriptProperty]
      [Range(0.1, double.MaxValue)]
      [Display(Name="UpVolume1", Order=1, GroupName="Parameters")]
      public double UpVolume1
      { get; set; }

      Comment


        #4
        You would want to use an integer input instead of a type double. Something like the following would let you select the integer in the indicators properties.

        #region Properties
        [NinjaScriptProperty]
        [Range(0, int.MaxValue)]
        [Display(Name="MyBarsAgoValue", Order=1, GroupName="Parameters")]
        public int MyBarsAgoValue
        { get; set; }
        #endregion
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh,

          Great. Thanks for the info.

          Once again I have to say that you folks are very helpful and it is very much appreciated.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Gerik, Today, 09:40 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by RookieTrader, Today, 09:37 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by alifarahani, Today, 09:40 AM
          0 responses
          5 views
          0 likes
          Last Post alifarahani  
          Started by KennyK, 05-29-2017, 02:02 AM
          3 responses
          1,285 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by AttiM, 02-14-2024, 05:20 PM
          11 responses
          186 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X