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 Mestor, 03-10-2023, 01:50 AM
        16 responses
        388 views
        0 likes
        Last Post z.franck  
        Started by rtwave, 04-12-2024, 09:30 AM
        4 responses
        31 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        29 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        22 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        7 views
        0 likes
        Last Post funk10101  
        Working...
        X