Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Input variable in the Script Editor is not the same as seen in the strategy analyzer?

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

    Input variable in the Script Editor is not the same as seen in the strategy analyzer?

    Hi,

    Apparently I must not understand or be missing something. I am looking at a strategy in the Ninja Strategy Script and default parameters for an input t variable is not what I'm seeing when the script is loaded with the strategy analyzer.

    This is really strange what am I missing?

    The value in the souce code for PctLoss = .003.

    The value I see in the Strategy Analyzer is PctLoss = .01 ?

    No idea why this is happening the program successfully compiles.

    Thank you,

    glen
    Attached Files

    #2
    Hello demarcog,

    Thank you for your post.

    Does the NinjaScriptProperty for your user input variable specify a minimum Range attribute value? A Range attribute determines if the value of the following declared property is valid within a specified range.

    The Range attribute minimum value for the user input variable would need to be less than 0.003 in order to use 0.003 for the variable.

    See this help guide documentation for more information about the RangeAttribute - https://ninjatrader.com/support/help...eattribute.htm

    Let us know if we may assist further.

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Is there a "Default" strategy template for this strategy?

      Check folder,
      <user>\NinjaTrader 8\templates\Strategy\<strategy>

      Perhaps a "Default.xml" is overriding your defaults?

      Comment


        #4
        Thank you both I very much appreciate the help.

        The variable was set when State.SetDefaulta PctLoss = .01; in the code itself.

        Then the "properties" which csharp is my first experience with the concept of "propertties".

        And David brilliantly nailed it as there was also a template where it was being set to .01, when I deleted the template I then see the value I was expecting, .0003.

        [Display(Name = "Allowable loss percentage", GroupName = "NinjaScriptStrategyParameters", Order = 0)]
        public double PctLoss
        {
        get { return pctLoss; }
        set { pctLoss = Math.Max(0.001, value); }
        }



        Thank you both again for taking the time and explaining this it was mystifying me for a while there.

        glen

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        137 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        120 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        72 views
        0 likes
        Last Post PaulMohn  
        Working...
        X