Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyser Input Problem

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

    Strategy Analyser Input Problem

    Hello, I just wanted to Report something that just happened to me, if this is a problem what you're aware of just delete this Post, but as I was looking for a Solution and didn't find anything
    I thought to report it.

    I needed a new Input in my Script and made this:

    [NinjaScriptProperty]
    [Range(.0, int.MaxValue)]
    [Display(Name="FCloseat", Description="-4 to 4", Order=212, GroupName="Parameters")]
    public int FCloseat
    { get; set; }

    I compiled it and made a test run , with value +4, in Analyser and I noticed I made a mistake as it had to be a double and so changed it to:

    [NinjaScriptProperty]
    [Range(-10.0, double.MaxValue)]
    [Display(Name="FCloseat", Description="-4 to 4", Order=212, GroupName="Parameters")]
    public double FCloseat
    { get; set; }

    I test again and I have the same Results, so as my Script is very complicated, over 7000 lines, I first thought I made a mistake somewhere and run my debugs

    I debugged it to the point of having the line:

    Print(Time[0] +" FCloseat is "+FCloseat);

    what I first found rediculus, but you never know and the Result was:

    02.12.2020 18:05:00 FCloseat is 0

    So I thought I made a mistake in declaration and worked again on the Input, but I could do whatever I wanted it didn't worked so after a while I decided to remove it
    completely and I made a private double FCloseat on top of the Script and initialized it with 4. Compiled all good Print is 4, I remove the private douple and copy in again
    the whole block of:

    [NinjaScriptProperty]
    [Range(-10.0, double.MaxValue)]
    [Display(Name="FCloseat", Description="-4 to 4", Order=212, GroupName="Parameters")]
    public double FCloseat
    { get; set; }

    and I didn't made any change since I deleted it and complied it again, test run and print is:

    02.12.2020 18:05:00 FCloseat is 4

    So I made a further test and declared a new input double and print was as it should (4), if I made a new Int input, compile and change it then to double, compile again and
    run it it shows zero again.

    So my conclusion is that the Analyser is keeping it as a "int" as long its not gonna be removed, or I guess the Analyser is closed and reopen again.


    As I found it very frustrating loosing some time on this I thought I post it...



    #2
    Hello nemnem,

    Thank you for the post.

    What you described sounds like it would be expected. Any time you make changes to the overall class, that includes the public properties, you need to remove and re add the script from wherever it was applied. In the analyzer that would involved selecting a different script or closing and re opening the tool. The same is required if you edit defaults in State.SetDefaults.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Omg,, this sounds worse than, marriage!
      wow. Goodluck!
      I'm a newbie, here.

      Comment


        #4
        Spinach Man If you are making changes to the definition of the public interface ( the public properties ) then you do have to do as Jesse says. But if you change the implementation inside your OnBarUpdate then you don't have to select a different script.
        Automatic Trading Signals
        NinjaTrader Ecosystem Vendor - automatictradingsignals.com

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        4 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Working...
        X