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

Strategy based on BBS indicator

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

    Strategy based on BBS indicator

    Hi everyone

    I'm currently using the BBS indicator that I downloaded here.

    I'd like to use it to set up an automated strategy, but how should I do exactly? The BBS indicator returns dots and arrows, not values.

    I read this into the code:
    To get BBS dot values use :
    // BBS(2,1.5,20).DotValues.Get(CurrentBar)
    // Possible dot values are '0' for no data, '2' for squeeze alert, '1' for squeeze on, and '-1' for squeeze off

    So I guess I should use value 1 for entries and value -1 for exits?
    What about the direction of the trades?

    Many thanks in advance

    #2
    You would need to contact the author and ask him for clarification on the meaning of the values provided.

    Comment


      #3
      I haven't tried it, but I think it would be something like this to place trades where the little green arrows are positioned....

      Code:
      if (BBS(2,1.5,20).DotValues[0] == 2)
      {
         if (BBS(2,1.5,20).BarValues[0] < 0)
         {
            // Go long
         }
         else
         {
            // Go short
         }
      }

      Comment


        #4
        Thank you very much, KBJ.

        How would you write the code for the exit conditions (two darker bars in a row)?

        Many thanks again

        Comment


          #5
          Hi stefy,

          A squeeze indicates indecision in the market, so the theory goes that you enter a trade once the squeeze is off (-1 DotValue) in the direction of the bars, or any other indicator you care to use...

          Comment


            #6
            Stefy, Did you ever get this to work? I'm trying to do the same but am confused about how to use an indicator from within a strategy. I have the BBS Squeeze indicator. It's an object, not a method. I thought that I would need to construct an instance of the BBS Squeeze in the strategy Initialize() method and call properties on the squeeze object. But I see from this thread you're using a BBS method. How can that work? Where is this method? Why don't you need to hold the object? Doesn't the object maintain state? See my thread on this matter here: http://www.ninjatrader-support2.com/...479#post116479
            Thanks,
            Tim

            Comment


              #7
              Tim,

              All indicators can be called like methods. What state are you trying to maintain?

              For instance, take the SMA indicator. To access SMA values just go SMA(20)[0].

              For BB Squeeze (this is just my guess as to what this indicator is/does) you could go BBSqueeze(some parameters).SomePlot[0]
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Hi Brillo,

                It was some time ago, but I was calling the "Dot Values" in the BBS Squeeze (which can be 0, 1, 2) like this:
                BBS(2,1.5,20).DotValues[0]
                and the BarValues like this:
                BBS(2,1.5,20).BarValues[0]

                I hope I answered your question, otherwise feel free to ask for more.

                Have a nice day,

                Stefy

                Originally posted by Brillo View Post
                Stefy, Did you ever get this to work? I'm trying to do the same but am confused about how to use an indicator from within a strategy. I have the BBS Squeeze indicator. It's an object, not a method. I thought that I would need to construct an instance of the BBS Squeeze in the strategy Initialize() method and call properties on the squeeze object. But I see from this thread you're using a BBS method. How can that work? Where is this method? Why don't you need to hold the object? Doesn't the object maintain state? See my thread on this matter here: http://www.ninjatrader-support2.com/...479#post116479
                Thanks,
                Tim

                Comment


                  #9
                  Hi Stefy, Thank you. I understand it better now. The NinjaScript generated code at the bottom of the indicator source file adds some methods to the Indicator class that allow you to construct the indicator using function like syntax. That same code binds it to the Input dataseries. There's also an overload to bind it to an arbitrary DataSeries object you pass in.
                  Tim

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by reynoldsn, 05-10-2024, 07:04 PM
                  6 responses
                  37 views
                  0 likes
                  Last Post reynoldsn  
                  Started by ETFVoyageur, 05-07-2024, 07:05 PM
                  22 responses
                  181 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by ETFVoyageur, Today, 02:15 AM
                  5 responses
                  30 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by drnoggin, Today, 12:19 PM
                  1 response
                  14 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by synthhokie, Today, 12:00 PM
                  1 response
                  16 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X