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 NullPointStrategies, Today, 05:17 AM
        0 responses
        53 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X