Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Decimals not accept in strategy

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

    Decimals not accept in strategy

    Hello

    I have an ATR Trailing Stop indicator I downloaded from a link off this site from Bertrand. It works quite well

    With the indicator I can set the Multiple input to a decimal like 1.8

    I added this indicator to a strategy which is working however in the strategy editor I cannot enter 1.8 in the multiple.

    I tried to make sure the chart indicator had the same value but it still would not work

    I am guessing there is some place in the strategy code I need to change the type of variable I am using?

    Any help would be appreciated

    Stefan

    #2
    Hello Stefan,

    Thank you for your post.

    Do you have a link of the indicator that I can look into and test this on my end?
    Cal H.NinjaTrader Customer Service

    Comment


      #3


      It is down the bottom of the page posted by Bertrand

      thank you

      Comment


        #4
        Stefan,

        I am able to pass through a 1.8 value.

        What is your exact syntax that you are using for this?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Sorry for the confusion

          As I stated below if I use the indicator on a chart it will work fine.

          It is when I use it in a simple strategy enter and exit on a cross of the ATR.

          The strategy itself works but when I start the strategy and in the edit properties I try to change the value there it will only let me put a whole number.

          Attached is the strategy
          Attached Files

          Comment


            #6
            I'm kinda new with this but here is my guess:
            What you refer to "Multiple" in your post I'm guessing is actually "Factor" in your strategy code.

            "Factor" is defined as an "int" in the strategy but is probably double in the indicator.


            Also: a property of Factor is that the minimum value it can be set to is 1 (one)

            [Description("Atr Factor")]
            [GridCategory("Parameters")]
            public int Factor
            {
            get { return factor; }
            set { factor = Math.Max(1, value); }
            }


            Hope this helps.

            Comment


              #7
              Thanks

              I changed the variable setting and the property factor to double and that worked

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              6 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              9 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              20 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X