• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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
    Patrick H.NinjaTrader Customer Service

    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
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by JPPoulin, Today, 01:32 PM
        2 responses
        11 views
        0 likes
        Last Post JPPoulin  
        Started by bltdavid, Today, 01:09 PM
        0 responses
        9 views
        0 likes
        Last Post bltdavid  
        Started by pstrusi, Today, 12:50 PM
        2 responses
        8 views
        0 likes
        Last Post pstrusi
        by pstrusi
         
        Started by ralett, Today, 11:52 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by rtwave, Yesterday, 07:06 PM
        2 responses
        27 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Working...
        X