Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged Sell Limit orders not appearing in Orders window

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

    Unmanaged Sell Limit orders not appearing in Orders window

    Hello everyone,

    I am currently programming an automated strategy using unmanaged ordrs to be able to place Sell and Buy limit ordres in the same time.

    My problem is that the initial sell limit order never appears on the "orders" window of NinjaTrader, despite the fact that the logs indicates me no errors and after that, the limit price of the trade is logged, trade status is "working" and I can sucessfully update the limite price.

    Ths problem does not appear on the buy limit, and no problems too if I open manually a sell limit.

    I am using Ninja 7.4, with a Zenfire feed from a Mirrus demo account.
    Issue is appearing on live execution with simulated datafeed or zenfire one.

    Backtests are fine and sell limit order appears on the report with no problems.

    This issues begins to drive me crazy so I would be very grateful if someone would have a clue on what happens.

    Many thaks!

    #2
    Hello,

    Thanks for that information.

    When you run the strategy live is it going to a green state in the control center strategies tab indicating it is active.

    Also, If you add TraceOrders = True in the Initialize Method you will be able to trace the orders to see what is happening.




    Please let me know the trace output from here if there is any.

    I look forward to assisting you further.

    Comment


      #3
      Thank you for your help.

      Yes the strategy goes green and I activated the trace. The trace reports the order creation wihtout any errors. I will be able to send the logs only later.
      The state of the ghost trade printed in logs is "working"...

      Comment


        #4
        Hello,

        THanks for that, and we are sure this is a live order not a historical order correct?

        I look forward to assisting you further.

        Comment


          #5
          Actually you maybe touch a interesting point here.
          I launch the strategy via the Strategy window. Whre can we be sure it is executing on live data and not historical one.
          I am not using Strategy Analyser here (and it is working on the analyseer by the way).

          Thanks

          Comment


            #6
            Hello,

            It is seemless from historical to live. The strategy actually would not know the difference. You would just need to check the order times in the output window. If the order time is less then the start time of the strategy -> Historical. Vice Versa.

            Let me know if I can be of further assistance.

            Comment


              #7
              Here are some traces at the sell and buy limit order opening :

              Code:
              Place init orders
              01/04/2011 13:20:07 Entered internal SubmitOrder() method at 01/04/2011 13:20:07: Action=Sell OrderType=Limit Quantity=1 LimitPrice=1.4259 StopPrice=0 OcoId='' Name='Strat1ShortLimitI'
              Working
              01/04/2011 13:20:07 Entered internal SubmitOrder() method at 01/04/2011 13:20:07: Action=Buy OrderType=Limit Quantity=1 LimitPrice=1.3979 StopPrice=0 OcoId='' Name='Strat1LongLimitI'
              Opening Long Limit order: 1.3979
              Opening Short Limit order: 1.4259
              The working status and limit prace are taken through the trade object, indicating that the trade is successfully entered.

              Comment


                #8
                Hello,

                RIght but what was the starting time of the strategy. It should time stamp the time at the top of the output window when you enable the strategy.

                Comment


                  #9
                  I run it yesterday, so this data are indeed past data.

                  Comment


                    #10
                    Hello,

                    Ok if you run it again today can you please post the start times and order times of the strategy it is here we will be able to identify they are historical orders.

                    Which we most likely will. At that point you simply need to wait for a live order to be submitted. Also you will want to make sure you read up on this document.

                    Strategy Position vs. Account Position:

                    1st solution:
                    You can include the following statement in your code to avoid the strategy to be calculated on historical data.
                    // Only run on real-time data
                    if (Historical)
                    return;
                    Add the statement to the top of OnBarUpdate()
                    2nd solution:
                    You can set 'On starting a real-time strategy' to 'Wait until flat before executing live'.
                    This option can be found at Tools-->Options-->Strategies-->NinjaScript-tab.
                    3rd solution, would be submitting manual orders to sync the strategy and account positions described in the link
                    4th solution, would be to enable Sync account position to true.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by GLFX005, Today, 03:23 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post GLFX005
                    by GLFX005
                     
                    Started by XXtrader, Yesterday, 11:30 PM
                    2 responses
                    11 views
                    0 likes
                    Last Post XXtrader  
                    Started by Waxavi, Today, 02:10 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post Waxavi
                    by Waxavi
                     
                    Started by TradeForge, Today, 02:09 AM
                    0 responses
                    13 views
                    0 likes
                    Last Post TradeForge  
                    Started by Waxavi, Today, 02:00 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post Waxavi
                    by Waxavi
                     
                    Working...
                    X