• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ShortStop and ShortLimit at the same time

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

    ShortStop and ShortLimit at the same time

    hey guys

    in my very simple strategy i just want to place a shortstop and a shortlimit order at the same time

    like this:

    EnterShortLimit(entryLevel+20*TickSize,"Shortlimit ");
    EnterShortStop(entryLevel-20*TickSize,"Shortstop");

    sadly the strategy only places the first Order
    any help?

    regards, Deorn

    #2
    Deorn, thanks for the post - this would be unfortunately expected in the managed mode as this approach with competing orders would be caught by the Internal Order Handling Rules -

    http://www.ninjatrader.com/support/h...d_approach.htm (bottom section here).

    For more flexibility we have the Unmanaged mode as well in NT7, where those 'guards' would not be effective - http://www.ninjatrader.com/support/h...d_approach.htm

    Yet another approach would be monitoring price and only submitting one order in managed mode then as needed.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      thanks for your response Bertrand

      sadly it still doesnt place the second order




      Code:
      protected override void Initialize()
      {
      
           CalculateOnBarClose = false;
          Unmanaged = true;
      }
      
      protected override void OnBarUpdate()
      {
          // Entries
      			SubmitOrder(0,OrderAction.Sell,OrderType.Limit,1,entryLevel+50*TickSize,0,"ocoshort","s1");
      			SubmitOrder(0,OrderAction.Sell,OrderType.Stop,1,entryLevel-50*TickSize,0,"ocoshort","s2");
      
      }
      please help
      i want that both orders are placed on the chart

      redards, deorn
      Last edited by Deorn; 03-11-2013, 03:35 AM.

      Comment


        #4
        I would suggest you check via the TraceOrders what exactly is happening on the hood with your order submission - http://www.ninjatrader.com/support/f...ead.php?t=3627

        Wouldn't the first order fill pretty much instantly and then cancel the second as they are OCO?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          giving them different ocoid doesnt fix the problem

          the traceorders command gives me this

          Code:
          08.03.2013 08:02:04 Entered internal SubmitOrder() method at 08.03.2013 08:02:04: Action=Sell OrderType=Limit Quantity=1 LimitPrice=7980,0 StopPrice=0 OcoId='ocoshort' Name='s1'
          08.03.2013 08:02:04 Entered internal SubmitOrder() method at 08.03.2013 08:02:04: Action=Sell OrderType=Stop Quantity=1 LimitPrice=7930,0 StopPrice=0 OcoId='ocoshort1' Name='s2'
          but i only see the limit order (the first order) been placed on a different fdax chart where the charttrader is enabled
          it also makes no difference if there is a open position in the fdax or not

          Comment


            #6
            Right, they are both submitted - but one would fill instantly, as you place it as marktable limit order, not a StopLimit / Stop order.

            Wouldn't the script show a strategy position then for you, with the one remaining stop order placed?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              can you write me the solution please

              Comment


                #8
                I guess I'm not exactly clear what you're trying to achieve - bracket the market with a limit order above the market to sell and below the market to buy?
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  no i just want to achieve a OCO TP and SL Order for a already opened long position

                  Comment


                    #10
                    Ok, then I would suggest not using the unmanaged mode, but just either working via :

                    1. The Set() methods (the generated stop / targets would be OCO'ed per se) -

                    http://www.ninjatrader.com/support/h...ofittarget.htm

                    2. Use the Exit() methods to submit your Limit target and Stop exit order, like shown here -

                    http://www.ninjatrader.com/support/f...ead.php?t=7499
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      thanks but that does not display the opened sl and tp orders onto the other chart where the charttrader is enabled, and I need that

                      my scenario is like that:
                      i have manually opened a long position, then I manually delete the inital sl and tp, start the ninja strategy, which put the sl and tp for the long position on the chart
                      and I want to see these two orders

                      I hope you understand that

                      Comment


                        #12
                        Thanks, but this would unfortunately not be possible with a NinjaScript strategy in general, if you had ChartTrader enabled. NinjaScripts are run as self contained instances managing the entry and exit conditions as programmed in your code.

                        If you wanted to manually adjust resulting orders, then you could for example call ATM Strategy Templates for exit management - however then the entry would have to come from the script as well.
                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by NinjaCustomer, Today, 12:14 AM
                        1 response
                        5 views
                        0 likes
                        Last Post NinjaTrader_Marco  
                        Started by U0000999, Yesterday, 11:49 PM
                        0 responses
                        4 views
                        0 likes
                        Last Post U0000999  
                        Started by ahadari28, Yesterday, 04:01 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post ahadari28  
                        Started by TazoTodua, Yesterday, 06:00 AM
                        2 responses
                        19 views
                        0 likes
                        Last Post TazoTodua  
                        Started by TazoTodua, Yesterday, 09:06 AM
                        1 response
                        12 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Working...
                        X