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

Bollinger band for targets

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

    Bollinger band for targets

    I have a strategy setup with a BB. When price closes above the BB i want to sell and have the middle band for profit targets. Opposite for buys. These are the setting i am using and I cannot get it to use the center BB. Any suggestions? Click image for larger version

Name:	BB middle line for targets on ES.jpg
Views:	457
Size:	221.1 KB
ID:	1111764

    #2
    Hello JTizz,

    Thanks for your post.

    Stops and Targets would be used for static targets/stops that do not rely on price action. We cannot use an indicator plot here as it would be based on price action.

    You will want to use Exit methods in Conditions and Actions and use an ExitLongStopMarket or ExitShortStopMarket method to submit your stop loss order. I have attached an example that uses Exit methods to control the stop loss.

    Exiting a position - https://ninjatrader.com/support/help...MarketPosition

    Conditions examples —https://ninjatrader.com/support/help...on_builder.htm

    Actions examples — https://ninjatrader.com/support/help...us/actions.htm

    We look forward to assisting.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      I tried your suggestions and it still doesnt work? Click image for larger version

Name:	Exit position.jpg
Views:	401
Size:	270.9 KB
ID:	1111791

      Comment


        #4
        Hello JTizz,

        You would not want to submit both an entry and exit method at the same time.

        You just have to look at sets 1 and 2 in the example, and the MoveToBE bool can be ignored.

        Set 1 checks if the position is flat and the entry condition is true and and enters. Set 2 checks if you are in a long position and places a Sell Stop Market order at the price level specified. You can use the Bollinger Band middle plot for the price level here.

        If you are finding that the stop is getting ignored when you test with Default Properties > More Properties > Trace orders checked (Open a NinjaScript Output window to see Trace Order prints) then this may mean that the Bollinger band plot is currently on the other side of the market and will not allow you to submit a stop to that level. You could then create another condition that checks if the current market price is on the other side of the Bollinger band plot, and call ExitLong to have the position closed.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          THX, I added 2 more sets and it works.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by joselube001, Today, 12:17 PM
          2 responses
          12 views
          0 likes
          Last Post joselube001  
          Started by arangocj, Today, 12:37 PM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by kevinenergy, Yesterday, 12:01 PM
          5 responses
          20 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Kraken29, Today, 12:32 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by codeowl, 02-11-2019, 05:47 AM
          23 responses
          679 views
          0 likes
          Last Post stockbux  
          Working...
          X