Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How Do I enter a trade not on the close but LOW???

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

    How Do I enter a trade not on the close but LOW???

    lets say that I want to enter on a doji but not on the close instead on the low of that candle. How would I write this in ninja script

    #2
    So you mean you would want to recognize a doji and then place a limit order to enter long at the low of the doji on the next bar?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Correct it should enter on the next bar

      Comment


        #4
        The orders would be placed by default on the next bar, so you can just act on your doji entry condition and place a limit order at Low[0] (the last completed bar on CalculateOnBarClose) - http://www.ninjatrader.com/support/h...rlonglimit.htm

        That order would stay for one bar only though, if you don't resubmit or set liveUntilCancelled to 'true'.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I got this so far Where would I put LiveUntilCancelled?

          Code:
           /// <summary>
                  /// This method is used to configure the strategy and is called once before any strategy method is called.
                  /// </summary>
                  protected override void Initialize()
                  {
                      CalculateOnBarClose = true;
                  }
          
                  /// <summary>
                  /// Called on each bar update event (incoming tick)
                  /// </summary>
                  protected override void OnBarUpdate()
                  {
          			
                      // Condition set 1
                      if (Open[0] == Close[0])
                      {
                          EnterLongLimit(DefaultQuantity,Low[0], "");
                      }
                  }

          Comment


            #6
            The liveUntilCancelled property would be set as part of the more advanced overload available for the EnterLongLimit() -

            Code:
            EnterLongLimit(int barsInProgressIndex, [I]bool liveUntilCancelled[/I], int quantity, double limitPrice, string signalName)
            In a single series script like yours the BarsInProgress would be then just 0.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              is this correct
              Code:
                protected override void OnBarUpdate()
                      {
              			
              			
              		
                          // Condition set 1
                          if (Open[0] == Close[0])
                          {
              				
                              EnterLongLimit(0,true,DefaultQuantity, Low[0], "");
                          }
                      }

              Comment


                #8
                Looks good, perhaps for identification would be better to name the signal explicitly.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Cool!!! Hey I have one more question to ask. how can I tell ninjatrader to exit the long position after 2 bars. I noticed that when I put profit target of 4 ticks, it thinks all of the candles are profitable....... or should I create a muti time frame that takes the long on the 1 min chart?? which one would work better

                  Comment


                    #10
                    Correct, per default it could not look intrabar - that's something we have on our feedback list for the next major update though.

                    For now a MultiSeries script would be best, sending to 1 min for example for execution and then using the Exit methods for your stop / target, so you could have them deciphered as well on the lower series with added granularity.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by frankthearm, Today, 09:08 AM
                    3 responses
                    7 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by yertle, Today, 08:38 AM
                    5 responses
                    15 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by adeelshahzad, Today, 03:54 AM
                    3 responses
                    16 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by bill2023, Yesterday, 08:51 AM
                    6 responses
                    27 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
                    80 responses
                    19,667 views
                    5 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X