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

String input variable

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

    String input variable

    How do I specify a string as an input variable? For an int I know I can do this:

    Code:
    [NinjaScriptProperty]
    [Range(0, int.MaxValue)]
    [Display(Name="ExtraTriggerPips", Description="Additional Pips (or ticks for futures) above/below trigger bar to enter", Order=4, GroupName="Parameters")]
    public int ExtraTriggerPips
    { get; set; }
    But how can I do this for a string?

    What I want to do is let the user enter a time in the format 07:30:58 (in other words, HH:MM:SS) and then I want to parse that internally.

    How do I do this?

    #2
    Hello westofpluto,

    Thanks for your post.

    You could use the Strategy Builder to set up a string user-input variable and then click the 'View code' button to see the code that is used to make it. To do so, open a New > Strategy Builder window, navigate to the Inputs and Variables screen, then create a string input in the Inputs section and click the 'View code' button.

    The code to create a user-input string would look something like this.

    Code:
    [NinjaScriptProperty]
    [Display(Name="MyStringInput", Order=1, GroupName="Parameters")]
    public string MyStringInput
    { get; set; }
    See this help guide page for more information: https://ninjatrader.com/support/help...ariablesScreen

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sidlercom80, 10-28-2023, 08:49 AM
    172 responses
    2,279 views
    0 likes
    Last Post sidlercom80  
    Started by Irukandji, Yesterday, 02:53 AM
    2 responses
    17 views
    0 likes
    Last Post Irukandji  
    Started by adeelshahzad, Today, 03:54 AM
    0 responses
    4 views
    0 likes
    Last Post adeelshahzad  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by WeyldFalcon, 12-10-2020, 06:48 PM
    14 responses
    1,431 views
    0 likes
    Last Post Handclap0241  
    Working...
    X