Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimizer doesn't allow uint as range input

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

    Optimizer doesn't allow uint as range input

    Topic says it all, shouldn't make a difference in the optimizer algo if int or uint is used right?

    #2
    Hello,

    What is uint? The optimizer does not work on tick data at this time, so any bar that uses tick data will not work. Use min. data.
    DenNinjaTrader Customer Service

    Comment


      #3
      Hi Ben!

      As it seems you are not familiar with C# programming so you might forward this topic to a programmer in your company.


      A good programmer usually chooses the correct data type because you can't trust user input. That is what I did in my custom strategy:

      Code:
      private uint NotEverGetNegative;
      Of course this has the appropriate set and get properties as public.


      With the uint datatype it is not possible to choose values in the strategy optimizer. This is Min. Value, Max. Value and Increment.

      For the int datatype it works. Of course point beeing, int nearly same as uint.

      Comment


        #4
        Hello,

        I am familiar with C#, but only in the context of NinjaScript. I have never seen that type used in NS. If I understand, uint will never be negative. Is that what you want? If so, the following will maintain a zero value for an negative int. Or you can modify it to change return absolute value etc. of what you want. This is found in Properties.

        [Description("")]
        [Category(
        "Parameters")]
        publicint MyInput0
        {
        get { return myInput0; }
        set { myInput0 = Math.Max(0, value); }
        }
        DenNinjaTrader Customer Service

        Comment


          #5
          Why make it simple if there's a complicated way to do it...


          No offense here but these value types are basic programming skills found in every programming book on the first pages.

          Anyway just consider adding it to the supported types in the strategy analyser. Thx!
          I'm out!

          Comment


            #6
            Hello,

            What I posted is a way to get it to do what you want. However I will have someone take a look at this on Monday and tell you for sure if that type is not supported. I do not think it is though.
            DenNinjaTrader Customer Service

            Comment


              #7
              NT only allows int and double as range input. We noted your request and will add it to the list of future considerations.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by martin70, 03-24-2023, 04:58 AM
              14 responses
              105 views
              0 likes
              Last Post martin70  
              Started by TraderBCL, Today, 04:38 AM
              0 responses
              2 views
              0 likes
              Last Post TraderBCL  
              Started by Radano, 06-10-2021, 01:40 AM
              19 responses
              606 views
              0 likes
              Last Post Radano
              by Radano
               
              Started by KenneGaray, Today, 03:48 AM
              0 responses
              4 views
              0 likes
              Last Post KenneGaray  
              Started by thanajo, 05-04-2021, 02:11 AM
              4 responses
              470 views
              0 likes
              Last Post tradingnasdaqprueba  
              Working...
              X