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 pibrew, Today, 06:37 AM
      0 responses
      1 view
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      12 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      11 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Working...
      X