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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      65 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      41 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      23 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      26 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X