Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Unmanged order strategy is not executing the same on live account

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

    Unmanged order strategy is not executing the same on live account

    Unmanged order strategy on the sim it works fine but on live it doesnt put stop loss and profit target like it does on the sim. Was wondering what was this about im guess it has to do with unmanged approach. How do I fix this issue?

    #2
    Hello rickyblah12,

    From the given details I wouldn't be able to say that unmanaged is specifically the reason. This would be a situation where you would need to look at the logic you made and see what worked differently in those two use cases. Without that detail I couldn't really provide any suggestions.

    To debug this you would need to run the script in both use cases and add some form of output like a Print to determine whats not working. Once you isolate what was not working we could look at that logic and try to find how to solve that.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      ok but where would the print go?


      Comment


        #4
        Hello rickyblah12,

        You will need to determine that based on what you created.

        You said that the targets were affected so that logic may be a good starting place.

        If the targets don't work and you are doing something to trigger the targets in OnBarUpdate the print would need to go in your OBU logic. If you are using the order events like OnOrderUpdate or OnExecutionUpdate you could start there. If you use these events you may also want to read the warnings surrounding those overrides as not all providers treat order events equally. https://ninjatrader.com/support/help...ub=onexecution

        The print could be anything from just text to variables you used in your logic, that will depend on your exploration and what part of the script needs to be debugged.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          This is what I have on the output window. What should I be looking for?

          10/5/2020 12:06:00 PM Strategy ' xxxxxx': Entered internal SubmitOrderUnmanaged() method at 10/5/2020 12:06:00 PM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=3 LimitPrice=0 StopPrice=0 SignalName='Long'

          10/5/2020 12:06:00 PM Strategy ' xxxxxx': Entered internal SubmitOrderUnmanaged() method at 10/5/2020 12:06:00 PM: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=3 LimitPrice=0 StopPrice=11410.25 SignalName='Stop Long'

          10/5/2020 12:06:00 PM Strategy ' xxxxxx': Entered internal SubmitOrderUnmanaged() method at 10/5/2020 12:06:00 PM: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=11446.50 StopPrice=0 SignalName='Profit Long 1'

          10/5/2020 12:06:00 PM Strategy 'xxxxxx': Entered internal SubmitOrderUnmanaged() method at 10/5/2020 12:06:00 PM: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=2 LimitPrice=11452.75 StopPrice=0 SignalName='Profit Long 2'

          10/5/2020 12:22:00 PM Strategy ' xxxxxx': Cancelled custom managed order: orderId='NT-00308-6896' account='phillip' name='Stop Long' orderState=Working instrument='NQ 12-20' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=11410.25 quantity=3 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-10-05 12:06:00' gtd='2099-12-01' statementDate='2020-10-07'

          10/5/2020 12:22:00 PM Strategy 'xxxxxx': Entered internal SubmitOrderUnmanaged() method at 10/5/2020 12:22:00 PM: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=2 LimitPrice=0 StopPrice=11410.25 SignalName='Stop Long'

          10/5/2020 12:24:00 PM Strategy ' xxxxxx': Cancelled custom managed order: orderId='NT-00311-6896' account='phillip' name='Stop Long' orderState=Working instrument='NQ 12-20' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=11410.25 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-10-05 12:22:00' gtd='2099-12-01' statementDate='2020-10-07'

          10/5/2020 12:24:00 PM Strategy 'xxxxxx': Entered internal SubmitOrderUnmanaged() method at 10/5/2020 12:24:00 PM: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=2 LimitPrice=0 StopPrice=11430.25 SignalName='Stop Long'

          10/5/2020 1:20:00 PM Strategy 'xxxxxx': Cancelled custom managed order: orderId='NT-00310-6896' account='phillip' name='Profit Long 2' orderState=Working instrument='NQ 12-20' orderAction=Sell orderType='Limit' limitPrice=11452.75 stopPrice=0 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-10-05 12:06:00' gtd='2099-12-01' statementDate

          Comment


            #6
            Hello rickyblah12,

            Is this something you are printing or you just noticed the order events were being output? The strategy will make some output when it has order events.

            From the given details it looks like the strategy is submitting orders and also cancelling some orders. I couldn't really say much else given only the output.

            Do you have logic to cancel orders?

            You also mentioned that you are using unmanaged but the note is mentioning managed orders being cancelled. Did you accidentally mix the managed and unmanaged approach? If so they cannot be combined and that may be part of the problem.


            I look forward to being of further assistance.



            JesseNinjaTrader Customer Service

            Comment


              #7
              there is cancel order logic but yes it is unmanged = true.

              where should I put the print exactly in the cancel order bracket or the execution bracket?

              Comment


                #8
                Hello rickyblah12,

                I understand that you set unmanaged to true, but are you still trying to use any managed type of orders in your strategy? When using unmanaged you can only create orders using SubmitOrderUnmanaged, are you doing that for all orders?

                where should I put the print exactly in the cancel order bracket or the execution bracket?
                That's going to be up to you and what you created. You have created a script but you have not provided any syntax yet so I really couldn't tell you where in your code a print would need to go. I only suggested that you may want to try and use Prints to figure out whats happening differently in those two use cases.

                You need to research your code and see what is not happening that would otherwise normally happen when you run it on sim. A print can help to determine if your logic is working differently. If you instead see the cancel as the reason its working different you would likely need to focus on what orders were being submitted or the cancellation logic. With that I would need to see what logic was used to better understand what may have happened.

                Please let me know if I may be of additional assistance.


                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by KenneGaray, Today, 03:48 AM
                0 responses
                3 views
                0 likes
                Last Post KenneGaray  
                Started by thanajo, 05-04-2021, 02:11 AM
                4 responses
                470 views
                0 likes
                Last Post tradingnasdaqprueba  
                Started by aa731, Today, 02:54 AM
                0 responses
                5 views
                0 likes
                Last Post aa731
                by aa731
                 
                Started by Christopher_R, Today, 12:29 AM
                0 responses
                10 views
                0 likes
                Last Post Christopher_R  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                166 responses
                2,237 views
                0 likes
                Last Post sidlercom80  
                Working...
                X