Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I Want To Specify Long Entry With Stop Limit 2 Ticks Above Bar 1

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

    I Want To Specify Long Entry With Stop Limit 2 Ticks Above Bar 1

    I want to specify a long entry with a Stop Limit order 2 ticks above the last bar's close. How is this done in code. I have gotten this far:
    EnterLongStopLimit(Close[1]);
    But I do not know how to enter the 2 ticks above bar 1.

    #2
    You need to use the entry order method signature with at least 2 parameters. Make sure you study the help guide to show you exactly what the various combinations of parameters are available to use.

    So, for example:

    EnterLongStopLimit(Close[1] + TickSize*2, Close[1] + TickSize*6)

    Assuming I haven't made any dumb mistakes (very tired at the moment, LOL), what you'll get is an entry order with a stop price 2 ticks above close of last bar and a limit price of 6 ticks above close of last bar.

    More info on this method at http://www.ninjatrader.com/support/h...gstoplimit.htm
    Last edited by coolmoss; 12-19-2013, 07:13 PM.

    Comment


      #3
      Hello bijan,

      Coolmoss gave a great example, but you will want to make sure the limit price is equal to or greater than the stop price for a buy orders. So for "EnterLongStopLimit(double limitPrice, double stopPrice)" you may want to use "EnterLongStopLimit(Close[1] + TickSize*2, Close[1] + TickSize*2)" for example.

      Also, to make sure your order is not rejected you may want to make sure that your Stop price is above the current market as well so you may want to check to see if "Close[1] + TickSize*2" is greater than "Close[0]".
      JCNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      388 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      260 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      218 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      302 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      268 views
      0 likes
      Last Post CarlTrading  
      Working...
      X