Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 locks up on entry error

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

    NT8 locks up on entry error

    I didn't have time this morning to scan the forums for this error...(to see if it was already posted).....so apologies if it is being addressed.

    I fumble fingered while entering the parameter for an indicator.
    NT8 properly caught the entry error but locked up tighter than a drum while it spit out 100s of error messages to the log.

    The error message......(100s of them)....in the Ninja Log is

    2016-03-24 09:55:03:678|0|4|Value of property 'poles' of NinjaScript 'SSmooth' is 0 and not in valid range between 1 and 2147483647.

    The Ninja code is

    PHP Code:
    [Range(1int.MaxValue)]
    [
    Display(ResourceType typeof(Custom.Resource), GroupName="1.Setup"Name="  Param "Order=7Description="")]
    public 
    int mtfParam
    getset; } 
    I don't have a problem with Ninja sending me error messages, but I can't have it locking up every time someone fumble fingers an entry. Please tell me this is in Beta 10....

    Thanks.....

    #2
    Hello photog53,


    I have submitted a feature request to the product management team for the following feature :


    This customer would like to see the log truncated so that duplicated error messages are collapsed to a single line showing the number of occurrences past the first 3 occurrences. For example,
    2016-03-24 09:55:03:678|0|4|Value of property 'poles' of NinjaScript 'SSmooth' is 0 and not in valid range between 1 and 2147483647.
    2016-03-24 09:55:04:678|0|4|Value of property 'poles' of NinjaScript 'SSmooth' is 0 and not in valid range between 1 and 2147483647.
    2016-03-24 09:55:05:678|0|4|Value of property 'poles' of NinjaScript 'SSmooth' is 0 and not in valid range between 1 and 2147483647.
    (975 more)

    I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.


    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for responding....all I actually need is simply for NT8 to not lock up and die when this happens. If that is what you meant by "fewer messages" then we agree.
      Last edited by photog53; 03-29-2016, 08:44 AM.

      Comment


        #4
        Hello photog53,

        I believe I misunderstood your request initially. If you would like to prevent values outside of the allowed range, you will want to specify a default value that is within range inside your "if (State == State.SetDefaults)" action block of the OnStateChange method. If you do not specify a default value, a default value of 0 is automatically assigned to this variable. Since you have a specified range between 1 and the largest integer C# will allow, this is causing the error you saw.

        I am providing an example :

        Code:
        [FONT=Courier New]
                    if (State == State.SetDefaults)
                    {
                        Description                            = @"Enter the description for your new custom Strategy here.";
                        Name                                = "Example1488634";
                        Calculate                            = Calculate.OnBarClose;
                        EntriesPerDirection                    = 1;
                        EntryHandling                        = EntryHandling.AllEntries;
                        IsExitOnSessionCloseStrategy        = true;
                        ExitOnSessionCloseSeconds            = 30;
                        IsFillLimitOnTouch                    = false;
                        MaximumBarsLookBack                    = MaximumBarsLookBack.TwoHundredFiftySix;
                        OrderFillResolution                    = OrderFillResolution.Standard;
                        Slippage                            = 0;
                        StartBehavior                        = StartBehavior.WaitUntilFlat;
                        TimeInForce                            = TimeInForce.Gtc;
                        TraceOrders                            = false;
                        RealtimeErrorHandling                = RealtimeErrorHandling.StopCancelClose;
                        StopTargetHandling                    = StopTargetHandling.PerEntryExecution;
                        BarsRequiredToTrade                    = 20;
                        MtfParam                            = 1;
                    }[/FONT]
        You can use code like the following to prevent "fumble finger" entries whenever you use your MtfParam variable in your code

        Code:
        [FONT=Courier New]if (MtfParam < 1)
        {
            MtfParam = 1;
        }
        [/FONT]
        Please let us know if there is any other way we can help.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Yes, I think we are together....

          Example:

          PHP Code:
          [Range(099)]        
          [
          Display(ResourceType typeof(Custom.Resource), GroupName="1.Setup"Name="    (FileID#)"Order=2Description=" ")]
          public 
          int uniqueNumber
          getset; } 
          and the user accidentally keys in 999...( or something not between 0-99)....

          What I got was a simple user entry error triggering so many log entries that Ninja froze up... What I expected to see was a simple pop up back, telling the user they entered data out-of-range.

          If this is a problem, I can always remove "Range(0, 99)" from Properties and simply do my own edits...

          Thanks...........

          Comment


            #6
            Hello photog53,

            This feature is being reviewed by the product management team and has been assigned the following unique tracking ID

            SFT-1294
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Thanks, I appreciate your hard work

              ....(I do understand that this is a very specific situation and once I pinpointed exactly what was causing it, I see that it will be very tricky to mitigate at the Ninja level. It is not an issue that will affect very many people....and the workaround/avoidance on the coder's end...(me)... is pretty straight forward. Thanks again for taking the time to run the sample code I sent. I know you guys have lots going on

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,404 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              95 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              159 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X