Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy behavior when stopped

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

    Strategy behavior when stopped

    I use a strategy to assist in my order submission. I also sometimes use the DOM to submit orders for the same instrument. I understand that this is not recommended, but it is necessary for my approach at this time.
    I know that the strategy position will get out of sync from the actual account position.
    In order to get back in sync with the account position, I coded my strategy to call the CloseStrategy() method.
    To my surprise, as the strategy was stopping, it submitted and order, presumably to flatten it's position.

    I would like to turn this behavior off. What is the setting?

    Thanks,
    Gary Albers

    #2
    Hello Gary,

    Thank you for your post.

    You can override the CloseStrategy() method as listed in the Help Guide: http://ninjatrader.com/support/helpG...sestrategy.htm

    Another option or even in addition to the above would be to use the PositionAccount to check the actual position of the strategy in your conditions: http://ninjatrader.com/support/helpG...ionaccount.htm

    Comment


      #3
      If I override the CloseStrategy() method so that no closing orders are submitted how do I force the strategy to be disabled?

      Gary

      Comment


        #4
        Hello Gary,

        Thank you for your response.

        To disable the strategy without calling CloseStrategy logic or the need to override it, set the state of the object (strategy) to terminated. Take a look at the example at the following link: http://ninjatrader.com/support/helpG...s/setstate.htm

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        4 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Working...
        X