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

Decimal

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

    Decimal

    Hello,

    I'm making a indicator, that i need to uze bollinger bands. I asked that when the price close < Lower Bolinger it give me a sell signal.

    - Problem: The indicator Looks for more than 2 decimal houses.( Ex: 0.536)

    - What i want: A way that it only looks for the 2 decimals houses. ( ex: 0.53 ), so that 0.53 = 0.53(6) (for exemple)

    #2
    Originally posted by PauloP View Post
    Hello,

    I'm making a indicator, that i need to uze bollinger bands. I asked that when the price close < Lower Bolinger it give me a sell signal.

    - Problem: The indicator Looks for more than 2 decimal houses.( Ex: 0.536)

    - What i want: A way that it only looks for the 2 decimals houses. ( ex: 0.53 ), so that 0.53 = 0.53(6) (for exemple)
    Try Math.Round(LowerBollinger, 2)
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Originally posted by PauloP View Post
      Hello,

      I'm making a indicator, that i need to uze bollinger bands. I asked that when the price close < Lower Bolinger it give me a sell signal.

      - Problem: The indicator Looks for more than 2 decimal houses.( Ex: 0.536)

      - What i want: A way that it only looks for the 2 decimals houses. ( ex: 0.53 ), so that 0.53 = 0.53(6) (for exemple)
      Use the Round2TickSize() method on the indicator values.

      ref: http://ninjatrader.com/support/helpG...trument_ro.htm

      Comment


        #4
        eDanny

        I made a Strategy and than coppyed to Indicator and everything that said "Strategy" i changed to "Indicator" i dont know how to program :s is possible i show the code and you tell me wher exactly i put it?

        Comment


          #5
          Originally posted by eDanny View Post
          Try Math.Round(LowerBollinger, 2)
          You are missing the index specifier.

          Comment


            #6
            koganam

            I just add you on Skype is possible you to accept?

            Comment


              #7
              Originally posted by koganam View Post
              You are missing the index specifier.
              Sorry, quick pseudo code off the top of my head.
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment


                #8
                Hello PauloP,

                Thank you for your post.

                As koganam explained:
                Code:
                            if (Close[0] < Instrument.MasterInstrument.Round2TickSize(Bollinger(2, 20).Lower[0]))
                			{
                				// do something
                			}

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Kaledus, Today, 01:29 PM
                0 responses
                3 views
                0 likes
                Last Post Kaledus
                by Kaledus
                 
                Started by PaulMohn, Today, 12:36 PM
                1 response
                16 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by yertle, Yesterday, 08:38 AM
                8 responses
                37 views
                0 likes
                Last Post ryjoga
                by ryjoga
                 
                Started by rdtdale, Today, 01:02 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by alifarahani, Today, 09:40 AM
                3 responses
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X