Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with strategy please

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

    Help with strategy please

    Hello,

    Firstly let me say to create a new strategy is quite easy with the GUI setup you have in NT7 - bravo!

    However, I thought I had the details right for entry and exit but it seems not.

    My strategy:
    If I have two bars that consecutively close at their highs -> BUY (and inversely for the SELL side).

    Profit target = x-ticks / Stop Loss = x-ticks.

    If there are, for example, 9 bars in a row that consecutively close at their highs I want to continue opening positions i.e. the strategy is only backwards looking to the bar that just closed and the one before it. The real trouble I'm facing is getting my profit target and stop losses to work.

    If say, the first two bars closed at their highs I want to be Long 1 and with that have OCO orders with a profit target of 1 tick + stop loss of x-ticks. I then hit my profit target so I now have no positions open but then another bar closes on its highs therefore I'd open a brand new position with a new profit target of 1 tick + stop loss of x-ticks.

    However, if there are two bars that close at their highs (which would make me Long 1) and then immediately following it I have two bars that close at their lows (which theoretically would make me Short 1); I'd want to exit my long (sell 1) and enter a short (sell another 1).

    Please help me get my head around this; as I said I thought I had it figured out but running a backtest I saw my entries were all wrong.

    Many thanks.

    #2
    Hello Zhorny,

    However, if there are two bars that close at their highs (which would make me Long 1) and then immediately following it I have two bars that close at their lows (which theoretically would make me Short 1); I'd want to exit my long (sell 1) and enter a short (sell another 1).
    By default, entries will reverse a position, so you don't have to call separately an ExitLong(). The EnterShort() will close the long position and enter in that direction.
    Last edited by NinjaTrader_RyanM1; 01-26-2011, 09:05 AM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I'm sorry but I don't understand what you mean by "default entries".
      As you so rightly guessed I did have both the ExitLong() and EnterShort() in the SELL part of the strategy.

      Comment


        #4
        Hi Ryan,

        Please explain what you mean by "By default entries"

        Thanks,

        Z

        Comment


          #5
          Z, Ryan meant that standard behavior from NT is to reverse any open position if the Enter() methods are used. So you're short 1 contract and call EnterLong > NT will close the open short and buy one to get you net long.

          Comment


            #6
            Ok great thanks.

            What I'm also trying to achieve is:
            "If the bar just closing closes at the high and the bar before it closes at its high -> BUY (with limit and stop loss)". This might happen 10 times in a row (i.e. 10 bars in a row close at their high) so there will be no discrimination and the overall position size will increase.

            Could you please check if I've entered in the details correctly as I fear I am out by 1 bar (pics below).

            Many thanks


            Comment


              #7
              It looks to me like you would need to reference one bar earlier, so Close[0] vs High[0], Close[0] vs Close[1], otherwise you introduce a delay...

              Comment


                #8
                Yeah I thought it might be 0/0 & 1/1 instead of my 1/1 & 2/2. I'll try it out.
                How would one introduce a delay?

                Comment


                  #9
                  If the bar just closing closes at the high and the bar before it closes at its high
                  A delay is introduced because your screenshots did not match this description. You were delaying it by one bar, rather than using the "bar just closing"
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    It is working how I want BUT one last problem.

                    I can't get my Limits and Stops to work - so once I'm in the position it doesn't auto load the my OCO. I want a limit 1 tick away and a stop 6 ticks away...please see my settings below.

                    Am I missing anything that should potentially link these contingent OCO limits and stops in?

                    Comment


                      #11
                      Thanks for the screenshot.

                      I believe you have a couple fields swapped. The values are currently set as 0.

                      You can leave from entry signal blank, but type in a value for Value, like 1 or 6 in your screenshot.
                      Attached Files
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks for your help but I have another query now.

                        If a bar closes at the high how do I put an order to buy on stop (i.e. buy higher than the current price)?
                        Example: Let's say the asset's last bar closes at price 101.23, I want a rule in place that if it closes at the high take the close price and add 2 ticks i.e. Stop Order to Open 101.25.

                        Please let me know how I can do this.

                        Comment


                          #13
                          You can select EnterLongStop() as a default action in the strategy wizard.

                          Select Close, offset type ticks, and offset value 2.
                          Attached Files
                          Ryan M.NinjaTrader Customer Service

                          Comment


                            #14
                            Your second condition: Close[2] == Close[2], is identically true. Do you have an error there ?

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            633 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            364 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            105 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            567 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            568 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X