• 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 mohsemian, Today, 07:04 PM
        2 responses
        7 views
        0 likes
        Last Post mohsemian  
        Started by waldoalvarez, Today, 04:59 PM
        0 responses
        8 views
        0 likes
        Last Post waldoalvarez  
        Started by habibalex, Today, 09:45 AM
        2 responses
        18 views
        0 likes
        Last Post habibalex  
        Started by junkone, Today, 03:42 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by peterslane1, Today, 09:47 AM
        2 responses
        19 views
        0 likes
        Last Post aviat72
        by aviat72
         
        Working...
        X