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

CancelOrder behaviour in a strategy

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

    CancelOrder behaviour in a strategy

    Hi

    I have a strategy which has a DailyStopLossLimit property. This strategy does nothing else except monitor my PL and compares to the DailyStopLoss. if my daily loss exceeds this level it closes all positions and attempts to cancel any new orders entered.

    However the strategy doesn't control new order entry. I do that manually. When the strategy calls CancelOrder on any new orders that i've manually entered nothing happens.

    Can strategies cancel orders that they didn't originally submit? If not is there a work-around?

    I've tried CancelAllOrders(Intrsument) which does indeed cancel any order but that also kills the strategy and i dont want that to happen.

    thanks

    #2
    Hello weav74,

    Thank you for the post.

    In this situation it sounds like you would want to use an indicator with Addon code rather than a strategy. Strategies cannot control external orders, they are intended to only control their individual orders.

    You could use the Addon account methods for this from an Indicator rather than using a strategy. https://ninjatrader.com/support/help...ount_class.htm

    The purpose of the addon account is to observe the account directly which would act similar to the existing tools, that means you can watch for manually placed orders and do logic to modify those orders.





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

    Comment


      #3
      Hi Jesse
      Perfect. Exactly what i was looking for. Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Waxavi, Today, 02:10 AM
      0 responses
      3 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      8 views
      0 likes
      Last Post TradeForge  
      Started by Waxavi, Today, 02:00 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by elirion, Today, 01:36 AM
      0 responses
      4 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      4 views
      0 likes
      Last Post gentlebenthebear  
      Working...
      X