Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Best way to reset a strategy initiated position

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

    Best way to reset a strategy initiated position

    What is the right way to close the position outside strategy which has been initiated by strategy.

    I had a strategy running which took a position. I closed it outside from strategy (via SuperDOM) and now restart will initiate Yellow screen, (as it thinks that there is a position) If I switch tab to "Immediately submit live working historical order" it will enter and think that there is a position.

    "Strategies window" shows a position and avg position but how to reset that as there are none. (only one leading trail running or initiated but if this will be canceled, no effect)


    NT 7 (so this will keep track)

    (luckily not a live account)

    BR
    - mr

    #2
    Hello raffu,

    Unfortunatley there's no way to state a strategies position. This is created based on the signals of the strategy, run against historical data.

    One approach you may consider is to only the strategy on real-time data. You can do this with this line:

    if (Historical) return;

    This tells it to stop all historical processing, so there will be a flat state when you start the strategy.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok,
      so the most likely is that strategy will "close" the position at the end of the day as it should (actually some minutes before ending) but I don't want it to initiate position to other direction at that time. Let see ("Yellow" mode will do that if I have undersood that correctly..)

      Comment


        #4
        Hello raffu,

        It depends on settings used and strategy position at the time. This page is good for detailing potential outcomes here:



        Yellow means that it is waiting for the strategy position to reach a flat state before it will submit orders.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanls,

          Wait until flat before executing live, Sync account position = false

          clarified the situation, could be set at start of the strategy...

          Comment


            #6
            Originally posted by NinjaTrader_RyanM View Post
            One approach you may consider is to only the strategy on real-time data. You can do this with this line:

            if (Historical) return;

            This tells it to stop all historical processing, so there will be a flat state when you start the strategy.

            Where is this code placed in the strategy?

            Before the execution criteria IF statement? Or is it included with the && prefix.

            Thanks... from a C&P coder

            Comment


              #7
              Hello,

              This is placed right at the top inside OnBarUpdate()
              {
              if (Historical)
              return;
              }

              Comment


                #8
                Great Thanks.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Barry Milan, Yesterday, 10:35 PM
                5 responses
                16 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by DanielSanMartin, Yesterday, 02:37 PM
                2 responses
                13 views
                0 likes
                Last Post DanielSanMartin  
                Started by DJ888, 04-16-2024, 06:09 PM
                4 responses
                13 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by terofs, Today, 04:18 PM
                0 responses
                11 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by nandhumca, Today, 03:41 PM
                0 responses
                8 views
                0 likes
                Last Post nandhumca  
                Working...
                X