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

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.

    Brandon H.NinjaTrader Customer Service

    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 mgco4you, Today, 09:46 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        3 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X