Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StopLimit orders in NinjaScript

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

    StopLimit orders in NinjaScript

    I note that the StopOrders available in NinjaScript are market orders only. These are inefficent in slower moving markets, which seem to have become the norm these days.

    Can you introduce SetStopLossLimit() and SetTrailStopLimit() orders?

    Yes, I can and have programmed them, but I would prefer them to be built-in commands, rather than my user-built functions, not the least reason being that, as user-built functions, they require CalculateOnBarClose to be false, and I really do not like putting that heavy a load on the computer for each chart/strategy on which I am running.

    In other words, I want the order to be submitted as limit orders at the time they are sent to the exchange, when the entry order is submitted, putting them early in the queue; not have me monitoring price on every tick, so that I can submit the order, at which time it goes to the back of the queue.

    #2
    koganam, thanks for your feedback, I will provide a tracking # for it shortly - as a workaround for now you could work with the more detailed Exit methods that would for example offer a ExitStopLimit().

    Edit: We track your kindly provided feature request to enhance the Set's offered now under # 825.
    Last edited by NinjaTrader_Bertrand; 04-04-2011, 09:17 AM.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I did have a look at those, but I could not find anywhere where they could be created as OCO orders. e.g., a ExitLongLimit() target, with an ExitLongStopLimit() stop loss, as an OCO to an EnterLong().

      Maybe I am not reading in the correct places?

      Comment


        #4
        koganam,

        They are not submitted as OCO, but the managed order system will cancel any remaining exit orders if one of these fills and your strategy position is flat.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_RyanM View Post
          koganam,

          They are not submitted as OCO, but the managed order system will cancel any remaining exit orders if one of these fills and your strategy position is flat.
          Yes, that works for a single position (all in; all out).

          It does not seem to work for a multi-exit position.
          1. Buy 1 contract at EntryPrice. Use Exit...() orders for target1 and stop, using signal1 as name
          2. Buy 1 contract at EntryPrice. Use Exit...() orders for target2 and stop, using signal2 as name
          3. Buy 1 contract at EntryPrice. Use Exit...() orders for target3 and stop, using signal3 as name

          Notice that I am simply buying 3 contracts at the same price, and scaling out. Assuming no further management, the position will not be flat until the last target, while there will be 3 stop orders. So for example, if the market suddenly reverses after hitting target 1, the ExitLongStop() order will reverse me to 1 contract short, which may not be my intent.

          Comment


            #6
            If you provide unique signal names: Once that signals position is closed any remaining exit orders that match the signal name are cancelled. Attached is simple strategy you can run to see this. Run it against the simulated data feed so you can control target / stop loss fills.

            If you want more control on order submission, you can use the unmanaged approach, which does have the capability of specifying an OCO field for orders. You won't have any of the built in order management with this, so should only look into if you are running into limitations with the managed approach.
            Attached Files
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Jonafare, 12-06-2012, 03:48 PM
            5 responses
            3,986 views
            0 likes
            Last Post rene69851  
            Started by Fitspressorest, Today, 01:38 PM
            0 responses
            2 views
            0 likes
            Last Post Fitspressorest  
            Started by Jonker, Today, 01:19 PM
            0 responses
            2 views
            0 likes
            Last Post Jonker
            by Jonker
             
            Started by futtrader, Today, 01:16 PM
            0 responses
            8 views
            0 likes
            Last Post futtrader  
            Started by Segwin, 05-07-2018, 02:15 PM
            14 responses
            1,792 views
            0 likes
            Last Post aligator  
            Working...
            X