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 inanazsocial, Today, 01:15 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      10 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      2 views
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      23 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X