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 rocketman7, Today, 02:12 AM
        5 responses
        23 views
        0 likes
        Last Post rocketman7  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        7 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by samish18, 04-17-2024, 08:57 AM
        17 responses
        66 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by briansaul, Today, 05:31 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by PaulMohn, Today, 03:49 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X