Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Input Type Help

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

    Input Type Help

    I have a Indicator with inputs for value


    [NinjaScriptProperty]
    [Range(0, int.MaxValue)]
    [Display(Name="Preferred Min Chop Points", Order=1, GroupName="Parameters")]
    public int PreferredMinChopPoints
    { get; set; }

    I would like to input a decimal in steady of whole number, right now It will not take .50 only 1 and above

    [Range(0.01, int.MaxValue)]

    I tried to change Range to allow but still will only take 1 and above

    H1 and L1 are prev pivots as you might see in a ZigZag Plot, so the sum is in dollar values, so if the sum is < 30 for example on NQ that is 30 Points which is fine

    BUT FOR STOCKS needs to be maybe under 1 dollar or 1 Point, it would be much better to express in ticks

    double h1l1sumrangecheckC1 = H1[0]-L1[0];

    h1l1sumrangecheckC1 < PreferredMinChopPoints

    SHOULD I BE CHANGING THE FORMULA AND TRY TO EXPRESS IN TICKS

    double h1l1sumrangecheckC1 = ((H1[0]-L1[0] * 100);// FOR STOCKS

    double h1l1sumrangecheckC1 = ((H1[0]-L1[0] * 4);/FOR ES AND NQ

    LOOKING FOR IDEA OR VERIFICATION OF MY LAST THOUGHTS
    THANKS
    Happy Holidays

    #2
    Hello DTSSTS,

    Thank you for your post.

    An input set up as an int will only be able to accept whole numbers. Int is simply short for integer which is just a whole number with no decimals. If you want to use a decimal in that input, it would need to be changed to a double:

    Code:
    [NinjaScriptProperty]
    [Range(0, double.MaxValue)]
    [Display(Name="Preferred Min Chop Points", Order=1, GroupName="Parameters")]
    public double PreferredMinChopPoints
    { get; set; }
    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thanks for quick response, Can I also so as

      double h1l1sumrangecheckC1 = ((H1[0]-L1[0]) * 100);// FOR STOCKS

      double h1l1sumrangecheckC1 = ((H1[0]-L1[0]) - 4);/FOR ES AND NQ

      and then express as ticks


      [NinjaScriptProperty]
      [Range(0, int.MaxValue)]
      [Display(Name="Preferred Min Chop Ticks", Order=1, GroupName="Parameters")]
      public int PreferredMinChopTicks
      { get; set; }


      thanks again

      Comment


        #4
        Hello DTSSTS,

        Thank you for your reply.

        I'm a little confused by your calculations there - if I'm understanding correctly H1[0] - L1[0] gives you a price difference in currency, is that correct? And you wish to express that difference in ticks? If so you can just divide that by the TickSize to get the number of ticks difference:

        double h1l1sumrangecheckC1 = ((H1[0]-L1[0]) /TickSize);// FOR STOCKS

        double h1l1sumrangecheckC1 = ((H1[0]-L1[0])/TickSize);/FOR ES AND NQ

        Please let us know if we may be of further assistance to you.

        Comment


          #5
          Great Idea, I never did it that way or knew you could. Awesome solution.

          Have a wonderful Holiday

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          67 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          150 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          99 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X