Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterShortLimit question...

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

    EnterShortLimit question...

    I'm writing a strategy such that I would like to enter an order early then wait for the price to come to the order, possibly many points away. I'm using the command

    EntryOrder = EnterShortLimit(
    0, true, NbrContracts, EntryPrice, "Short");

    (BTW: I'm backtesting this)

    to see what is going on, I'm printing to the 'output' the time and price at the end of each bar, also in the
    OnOrderUpdate() I print out the status of the 'EntryOrder' so I see something like...

    1 83000 -> 923.25
    ++ Order='NT-00000/Back101' Name='C-O Short' State=PendingSubmit Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
    ++ Order='NT-00000/Back101' Name='C-O Short' State=Accepted Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
    ++ Order='NT-00000/Back101' Name='C-O Short' State=Working Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
    ++ Order='NT-00000/Back101' Name='C-O Short' State=Filled Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=919 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
    2 83300 -> 921.5
    3 83600 -> 922.25
    4 83900 -> 921
    5 84200 -> 921.75
    6 84500 -> 922.25
    7 84800 -> 923
    8 85100 -> 922
    9 85400 -> 923.5
    10 85700 -> 921.5
    11 90000 -> 921.25


    All of the state changes AND the fill occurs immediately instead of waiting for the price to occur.

    What am I doing wrong? where can I find examples ??

    Any response is greately appreciated.
    Cheers - David

    #2
    Saying sell short limit at 919 when price is 923.25 will get filled right away. Limit orders get you the limit price or better. For a short, a better price is any price higher than 919. At 923.25, the price is better and so the limit is triggered the moment you placed the order.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      EnterShortStopLimit and ExitShortStopLimit

      Thanks Josh,

      If I change the order to an EnterShortStopLimit() this would get me in at a price that I'm waiting for, so far so good. Exiting the position is done how?

      I've use the OnOrderUpdate() to exeute the exit order when the entry order is filled ...

      protected override void OnOrderUpdate(IOrder order)




      {
      if (CloseOpenEntryOrder != null && CloseOpenEntryOrder.Token == order.Token)

      {
      if (order.OrderState == OrderState.Cancelled)
      {
      CloseOpenEntryOrder =
      null;
      }
      if (order.OrderState == OrderState.Filled)
      {
      CloseOpenExitOrder = ExitShortStopLimit(
      0, true, NbrContracts, ExitPrice, ExitPrice, "C-O Short", "C-O Short");
      }
      }
      }

      this only generates the error in the 'tab log' ...

      7/3/2009 6:57:47 PM Strategy A BuyToCover stop order placed at '6/16/2009 10:48:00 AM' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.

      of course the stop price is less than the price for the current bar...I want to wait for the price to come to me...

      (my brain hurts)...Help!

      Comment


        #4
        Unfortunately you just can't do that. It is an illegal order and you need to change the prices for your orders to be legal.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          what do you mean 'legal' ?

          Is there an any good documentation (besides the help document) on the ExitShortStopLimit() command. for example what is the limitprice and the
          stopPrice.... why is there a difference? Can't they be the same value?

          Originally posted by NinjaTrader_Josh View Post
          Unfortunately you just can't do that. It is an illegal order and you need to change the prices for your orders to be legal.

          Comment


            #6
            David,

            What is legal is defined by the exchange. Stop prices are not the same as limit prices. http://www.investopedia.com/terms/s/stop-limitorder.asp
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            11 responses
            39 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by FrazMann, Today, 11:21 AM
            0 responses
            3 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            26 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X