Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

If Playback Mode is the most accurate way to back test, then we are in trouble

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

    #16
    Hello Glen,

    In the screenshots of your last post, we see the account position is 1 long here and here.

    Looking at the first screenshot here, I do not see a strategy applied to the chart, but the chart shows the account is 1 long, and the strategy using the 16 UniRenko data series (assuming this is the NQ strategy because your screenshot does not show which instruments have strategies applied) is flat (but the account is 1 long.) This would mean the strategy is out of sync with the account.

    Edit: Actually, the 16 UniRenko strategy is disabled so there is no calculated strategy position.

    Strategy positions are separate from actual account positions. As long as the strategy is the only thing submitting orders to the account, it will stay in sync with the account. If the strategy is out of sync after enabling it, you will want to have a good understanding on how the strategy gets its position when processing historical data, and how the start behaviors come into play.

    I have included some information on Start Behaviors and Strategy/Account Positions below.

    Strategy/Account Positions and Start Behavior information

    When a strategy is enabled, it processes historical data to determine trades that the strategy would have made on the data that is already on the PC/chart and to determine what position the strategy is in. (Strategy positions are separate from actual Account positions.)

    Wait Until Flat will wait until this virtual/historical position is closed before live orders can be submitted. It ensures that the strategy starts trading live from a flat position. If you enable the strategy when the account is flat, the strategy will wait until this position (calculated from historical data) is closed so it is logically making trades starting from an entry signal.

    Immediately Submit automatically submits working orders from when the strategy processed historical data, and assumes the strategy position and account position are where you want it when you enable the strategy. This is typically used to have a strategy resume a position after disabling/enabling. If the strategy already had live orders running, the orders will resume with the new enablement of the strategy if they match the historically calculated orders. If the orders calculated from historical data do not match the live working orders, the live working orders will be cancelled and replaced by those calculated from historical data.

    Sync Account Positions is an additional option that has NinjaTrader submit an order to sync the account position to the position calculated by the strategy. (Not the other way around.)

    Adopt Account Position would be used if you want the strategy to inherit the Account Position on enablement. This requires additional programming.

    If you do not want the strategy to calculate a position from processing historical data. Simply add if (State == State.Historical) return; to the top of your strategy logic so historical processing is skipped. The strategy will then always start from a flat position because it has not calculated any orders.

    Strategy vs. Account Position — https://ninjatrader.com/support/help..._account_p.htm

    Start Behaviors — https://ninjatrader.com/support/help..._positions.htm
    Last edited by NinjaTrader_Jim; 05-24-2021, 12:22 PM.

    Comment


      #17
      Hi Jim,

      Thank very much for explaining how that works. I may need to reread it a few times it's a bit complicated.

      In general when I'm running a strategy in l live account. I specify wait until flat. However as you mentioned there are times when for whatever reason the strategy was disabled and would have been short or long. I am not too concerned about activating the working orders but at times would like to have the strategy position in sync with the account position.

      What is the suggested way to if a strategy was disabled but now long for example to reestablish that long position. There are times especially if the signal was a really good one where you could remain dormant for hours missing the move entirely.

      I saw Chelsea had posted a buttons buy/sell sample strategy that will buy and sell.

      My assumption is that code would have to be integrated into a current strategy rather then simply loaded as an additional standalone strategy?

      It seems if you are going to run auto strategies on a regular basis you need some way of syncing the current position with the strategy position.

      I really appreciate your help on this. This area for some reason is the one I have the most difficulty understanding.

      As always thank you very much for your help. I'm going to have to just keep rereading these sections until it sinks in.

      Glen

      Comment


        #18
        Hi Jim,

        Please see attached trying to execute order for 1 contract message indicating I exceed the maximum position size which is 100.

        As I mentioned I thought I had sent this to you before but here is the screen capture your requested and I sent logs and traces.

        Attached Files

        Comment


          #19
          Hello demarcog,

          Thank you for your reply.

          Jim is out of the office currently, but I'm happy to help.

          We were recently made aware of erroneous risk templates that were added to the platform from a database update, which is the cause of the error message that you are receiving. In order to correct this item, you will need to first delete the erroneous risk templates then reset the Sim101 account.

          To remove the erroneous risk template;
          • Shut down NinjaTrader
          • On your PC, navigate to Documents/NinjaTrader 8/templates/Risk
          • Delete the risk templates titled '.xml', 'KPO.xml', and 'MES.xml'
          • I've included a video demonstration that I've made publicly available at the following link:
          Once you've deleted the erroneous risk templates, please do the following;
          • Restart NinjaTrader
          • From the NinjaTrader Control Center window select the Accounts tab
          • Right click on your simulation account and select 'Edit Account'
          • Ensure that 'None' is selected for the 'Risk' property
          • Press the "Reset" button
          • Select OK
          After completing the steps above, you should now be able to place orders in the Sim101/Playback 101 accounts without error.

          Please let us know if we may be of further assistance.

          Comment


            #20
            Hi Kate,

            Thanks for the update. I've seen recently some of the errors regarding the risk template. Are these templated also the cause for the other errors I received such as the one I sent to with 1 order and the error stating I exceeded the maximum order amount?

            There were several others, one telling me the strategy was not started, one where the minimum cash amount was not being met?

            If so that's great but when you said you have been recently made aware of this, how recent and how did you become aware?

            The reason I ask is because I reported this over a month ago and it has caused me nothing but grief and wasted tons of time?

            Rather then look into the problem I got a lot of pushback, nobody else is having the problem, we need more doc etc. etc.

            I'd really like to know what's going on?


            Thank You,

            glen

            Comment


              #21
              Hello demarcog,

              Thank you for your reply.

              My reply was specifically in regards to the risk template error, not in relation to the other errors you were receiving. The risk template issue specifically causes the error where it says you've exceeded the maximum position size.

              I'm not familiar with the other errors you mentioned - this is specifically in response to the error in your previous post.

              Thanks in advance; we look forward to assisting you further.

              Comment


                #22
                Kate,

                Thank you that error has basically shut down my ability to run Playback Mode and then SIM for a while.

                I am therefore extremely grateful support was able to resolve this issue as I knew you would,

                Wanted to thank you and Jim and apologize if my frustration was leaking into my posts as I knew it was a "real" issue not caused by anything I was doing as I was simply running some plain vanilla Playback and Sim testing.

                Thanks Again


                glen
                Last edited by demarcog; 05-30-2021, 10:47 AM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CarlTrading, Yesterday, 11:51 AM
                0 responses
                7 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, Yesterday, 11:48 AM
                0 responses
                11 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 03-25-2026, 09:53 PM
                0 responses
                11 views
                0 likes
                Last Post CaptainJack  
                Started by CaptainJack, 03-25-2026, 09:51 PM
                0 responses
                9 views
                0 likes
                Last Post CaptainJack  
                Started by Mindset, 03-23-2026, 11:13 AM
                0 responses
                16 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X