Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help - Simple BB reversion strategy

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

    Help - Simple BB reversion strategy

    Hi All,

    I am still getting familiar with NT8 strategy building and have a few intraday strategies which I am testing fine, but I am having trouble getting a daily BB based strategy to execute.

    Hoping someone with more experience can point me in the right direction.

    Click image for larger version

Name:	Screenshot 2023-04-28 at 11.07.04 am.png
Views:	129
Size:	77.9 KB
ID:	1248734

    #2
    Have you tried doing this with Strategy Builder? That seems well within its capabilities. You could then unlock the code and see how it does it in NinjaScript.
    Last edited by QuantKey_Bruce; 04-27-2023, 07:19 PM.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      hi there, yes this was done using strategy builder, I just displayed using script for ease of sharing.

      Comment


        #4
        Hello, thanks for writing in.
        In the Bollinger Bands indicator, the upper band is typically set to two standard deviations above the moving average, while the lower band is set to two standard deviations below the moving average. The high price of any instrument will not cross below the low of the lower Bollinger Band if the price is within the band's range. You can adjust the band being used in the left side of your condition, in the Bollinger Band settings "Plot Value". You can also debug your strategy using a Print and drawing to visually help explain the output of the strategy (i.e. No output or drawing object = condition is not true)

        In your stop loss, the "From Entry Signal" should have a capital L at the beginning. This string field is case-sensitive, so the Entry Signal And From Entry Signal must be exactly the same.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thanks!

          I am getting an error in the logs for "BarsRequiredToTrade" has not been met (screenshot attached).

          I have tried change the BRTT default to a value of 1, 5 and 50 and get the same error each time.

          Attached Files

          Comment


            #6
            After you changed your code where it is setting BarsRequiredToTrade = 50 or whatever, did you remove the strategy from the chart and add it back again? Because that setting is in State.SetDefaults it could be still remembering the previous value because it's saved on the chart itself from when you added the strategy the first time (which might have been before you changed the default and recompiled). Or, check your chart to see if the property Bars required to trade is changed on that instance of the strategy.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Pabulon, Today, 03:08 AM
            0 responses
            6 views
            0 likes
            Last Post Pabulon
            by Pabulon
             
            Started by sukhob, 05-18-2023, 08:26 PM
            2 responses
            128 views
            0 likes
            Last Post TraderJA  
            Started by timwey, Yesterday, 10:55 AM
            4 responses
            24 views
            0 likes
            Last Post timwey
            by timwey
             
            Started by DJ888, 06-28-2024, 10:18 PM
            3 responses
            39 views
            0 likes
            Last Post AdamDJ8
            by AdamDJ8
             
            Started by ntwong, Yesterday, 08:22 PM
            0 responses
            16 views
            0 likes
            Last Post ntwong
            by ntwong
             
            Working...
            X