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

Value of Property is 0

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

    Value of Property is 0

    Hi, I keep getting a error message from my strategy and cant figure out why. See attached picture. the base values for MOMS and MOMH are 5.1 and -5.2... there are both declared as type "double" ... There is no 0 possible for these value but I still get this text/error message... HELP PLEASE...
    Attached Files

    #2
    Hello JBU1314,

    You have set the range for this input to 1.2, double.MaxValue.
    If the value is 0 the error will occur.

    What is the default value this input is being set to in OnStateChange when State is .SetDefaults?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      it is set to 5.2 and -5.1 respectively - see attached...
      Attached Files

      Comment


        #4
        Hello JBU1314,

        The MOML requires the value to be set to 1.2 or greater.
        -5.1 is less than 1.2. This will cause an error.

        Is this making sense?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Unfortunatly it is not that simple... MOML requires the value to be set to 1.2 or greater.
          MOML is set to 5.2 ... MOMS requires the value to be set to -10.1 or greater.
          MOMS is set to -5.1.. so the logic is correct isnt it...

          Comment


            #6
            Ok, so last night i rewrote the script and all seemed to work ok. I did testing and all..
            After I shut NT down for the night. I opened it again this am and i receive the same error message again even while it worked great and without any errors last night. What can that be? It is really troubling and hinders me on doing my job. please help...

            Comment


              #7
              Why are you typing MOMS and MOML as double in SetDefaults?

              Comment


                #8
                I use over multiple instruments and sometimes need decimals

                Comment


                  #9
                  Yes, but you've already declared them in the properties as double.

                  Comment


                    #10
                    still same issue... even when declaration removed from Set.Defaults

                    Comment


                      #11
                      Hello JBU1314,

                      To assist, I've created a simple working script that has a double variable with 5.2 set as the value and prints the value in OnBarUpdate and uses this name MOML.
                      Attached Files
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Thank you very much for your efforts ChelseaB... I appreciate the time.. it is just strange since I did basically the same... and I still receive the error message from time to time. But I can backtest the strategy and it seems to work. I will finalize it and then set it live and see how it goes. I will be in touch again if it gives me more headaches. Again: THANKS!

                        Comment


                          #13
                          Originally posted by JBU1314 View Post
                          Ok, so last night i rewrote the script and all seemed to work ok. I did testing and all..
                          After I shut NT down for the night. I opened it again this am and i receive the same error message again even while it worked great and without any errors last night. What can that be? It is really troubling and hinders me on doing my job. please help...
                          Are you perchance touching any of those objects in State.Terminated?

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by mmenigma, Yesterday, 03:25 PM
                          1 response
                          11 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by kujista, Today, 05:44 AM
                          0 responses
                          7 views
                          0 likes
                          Last Post kujista
                          by kujista
                           
                          Started by ZenCortexCLICK, Today, 04:58 AM
                          0 responses
                          9 views
                          0 likes
                          Last Post ZenCortexCLICK  
                          Started by sidlercom80, 10-28-2023, 08:49 AM
                          172 responses
                          2,281 views
                          0 likes
                          Last Post sidlercom80  
                          Started by Irukandji, Yesterday, 02:53 AM
                          2 responses
                          18 views
                          0 likes
                          Last Post Irukandji  
                          Working...
                          X