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 wzgy0920, 04-20-2024, 06:09 PM
                2 responses
                27 views
                0 likes
                Last Post wzgy0920  
                Started by wzgy0920, 02-22-2024, 01:11 AM
                5 responses
                32 views
                0 likes
                Last Post wzgy0920  
                Started by wzgy0920, 04-23-2024, 09:53 PM
                2 responses
                49 views
                0 likes
                Last Post wzgy0920  
                Started by Kensonprib, 04-28-2021, 10:11 AM
                5 responses
                193 views
                0 likes
                Last Post Hasadafa  
                Started by GussJ, 03-04-2020, 03:11 PM
                11 responses
                3,235 views
                0 likes
                Last Post xiinteractive  
                Working...
                X