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

Cancelled orders

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

    Cancelled orders

    Hi Guys
    My strategy sometimes get some: New state = "cancel submitted" or New state = "cancelled"
    Some orders get cancelled on my playback. how does that work on live trading, I don't think trades will get cancelled without anything been calculated, just like that on live trading? so what happens in this case?

    #2
    Hello onlinebusiness,

    Thanks for your post.

    This indicates that a cancel was submitted for an order that was placed or that the order was canceled. This could occur when running a strategy live if orders are canceled. There are a number of factors that could cause an order to cancel.

    If you are using the Managed Approach order entry methods, keep in mind that by default orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted. This is noted on the help guide page linked below.

    Managed Approach: https://ninjatrader.com/support/help...d_approach.htm

    Calling CancelOrder() will also cause orders to cancel.

    CancelOrder(): https://ninjatrader.com/support/help...ancelorder.htm

    Order will also be canceled if you have a position open and the strategy encounters an error or the strategy is disabled.

    Please let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      so if this happened in live account how it is going to be calculated?
      just like closing a trade? either on profit or on loss, it will cancel the trade and calculate that as realised PnL?

      Comment


        #4
        Hello onlinebusiness,

        Thanks for your note.

        Yes this would be similar to a closed trade. If you have a working order and the strategy cancels the order, such as when an error occurs and the strategy cancels all working orders and disables, the Realized PnL will be calculated as a profit or loss depending on the position.

        For example, say you have a working long position, and the market moves in your favor. Then, the strategy encounters an error, the position is canceled, and the strategy disables. Since the market moved in your favor when the working order is canceled, the profit would be added to your Realized PnL.

        Note that you may see this message when using Stop Loss and Profit target orders, such as SetStopLoss()/SetProfitTarget(). Since these orders are tied together through OCO, once one order is filled, the other order will be canceled.

        Let me know if I may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        0 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        13 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        42 views
        0 likes
        Last Post yertle
        by yertle
         
        Working...
        X