Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

First Bar - Forward Testing on Historical Data w/ a Strategy Running Anomaly Question

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

    First Bar - Forward Testing on Historical Data w/ a Strategy Running Anomaly Question

    Hi there, Help Please. :-)
    I have a 'successful enough' Strategy, That I have put together. but they (my Strategies, built in strategy builder) always go through a lot of Back-Testing > ON REPLAY DATA, before I take them to the live Market Trading.
    This One, It is a Swing Strategy.
    Sometimes it will run across session closing. to the next trading day. on very rare occasion on the first Bar of the next Trading day. my trade will be closed, sometimes in Profit sometimes in Loss (I guess, because it hit my TP or SL). But both are wrong, when it does this, You can see in my example, this trade shows a closing price very far from the Chart Price at the moment of Closure on that first Bar of the day??? when this happens. if the jump is enough and hit my target or hit my stop. it will close that trade. most of the time 98+% of the time. this does not happen, if i have a trade carry over, on the first bar of the next session. So, My question is Simple. is this from a real moment in the market? on the first Tick of the Session ? or is this a fault of some kind in the NT8 Historical Data downloads ? IF I took a 100 trades that cross sessions, this problem only happens 1-2 times Max. But I still don't understand what is Closing the Trade, or How my Example Shown , can be this way.
    Any Comments Back, will be Greatly Appreciated
    Best Regards....
    P/s/
    The example shows the trade was in the red on that first bar. but it closed it as a profit Well Well above value of the Bar printed on the chart at the same moment.....
    Attached Files
    Last edited by Genesis2021; 05-02-2023, 11:16 PM.

    #2
    Hello Genesis2021,

    Thank you for your post.

    So I may assist you more accurately, please answer all of the following questions:
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
    • You mentioned you are testing on replay data; in the replay controller, do you have the Market Replay or the Historical bubble selected for data?
    • What instrument(s) (and expiry if applicable) have you selected?
      • Based on your screenshot, it looks like this example was on MES 06-23
    • What Data Series Type have you selected? Example: Tick, Minute, Day
    • What From and To date is selected?
    • Which Trading Hours template is selected in your Data Series settings?
    • Is your strategy a multi-instrument or multi-time frame strategy?
    • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    Thanks in advance; I look forward to further investigating this item.​
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hello Emily, i will try to answer your question here, Thank You
      • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
      • Answer - 8.0.27.1 64-bit
      • You mentioned you are testing on replay data; in the replay controller, do you have the Market Replay or the Historical bubble selected for data?
      • Answer - I see the Market Replay bubble is selected while i am testing.
      • What instrument(s) (and expiry if applicable) have you selected?
        • Based on your screenshot, it looks like this example was on MES 06-23
        • Answer - Yes MES 06-23 & MNQ 06-23 is the only two instruments I test right now. I think this issue is the same for both, it happens Rare, maybe once a week at most in 20-30 Trades taken.....
      • What Data Series Type have you selected? Example: Tick, Minute, Day
      • Answer - 5 Minute Time Charts
      • What From and To date is selected?
      • Answer - That screen shot was taken while i was using dates March 19th - April 21st. I apologize, but the trade date, i have no way to go back and see, but it would have been around March 26th or 27th First Bar of Session....
      • Which Trading Hours template is selected in your Data Series settings?
      • Answer - I think this is the same question as above ??? 5 Minute Time Charts, No Tick Replay Selected.
      • Is your strategy a multi-instrument or multi-time frame strategy?
      • Answer - No nothing Multi, only a 5 minute chart Strategy, used on either MES or MNQ. no other data sets or Times, are used on this Algo Strategy.
      • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
      • Answer - I don't think I get any Errors, But I will need this to happen again during testing to check this Properly for You.
      I have reset everything just today, to set up to run - BackTesting again for Both MES06-23 & MNQ06-23, with dates March 19th to April 28th this time. I run all BackTest in RealTime only 1x speed , So I can interact with the Charts, as if I was Trading Live on this Strategy. The Pc had a restart after I recorded what I sent to You, so I missed getting Trade or Execution info Screens recorded. So that is Unfortunate.

      Thank You Emily for taking your time to look into this for me....
      Best Regards



      Comment


        #4
        Hello Genesis2021,

        Thank you for your reply.

        I do see you are using version 8.0.27.1 and want to mention that there is an update to version 8.0.28.0 (release notes may be found here) available. To update NinjaTrader Desktop please follow the steps below.
        • Login into the NinjaTrader Account Dashboard
        • Click "Download" in the bottom left-hand corner of the sidebar
        • Next select "Download" in the "Most Recent Release" Window in the main screen
          • To get version 8.0.28.0, select it from the "Prior releases" box on the right-hand side
        • Once the installation had downloaded, ensure any previous version of NinjaTrader is closed before running the installation package.
          • Note: You may need to locate this in your "Downloads" folder in a Windows File Explorer

        I would like to clarify this bullet point:
        • Which Trading Hours template is selected in your Data Series settings?
        • Answer - I think this is the same question as above ??? 5 Minute Time Charts, No Tick Replay Selected.


        What I am referring to is the Trading Hours dropdown menu in the chart's data series. Please right-click your chart and select "Data Series." In the "Time frame" section there should be a selection for Trading Hours which determines the range of time shown on the chart. What do you have selected for this option?

        I am asking this because when trading in simulation (the Playback101 account is based on the Sim101 account) if you try to trade outside of market hours, there can be fill prices that seem pretty far off due to fluctuations in the bid/ask prices that can occur outside of normal trading hours. Since these unexpected fill prices are happening on the first bar of a session after the session break, I am curious if it might be related to how the simulator engine fills based on different variables, including bid/ask volume, trade volume, time, etc. This is described in note number 1 on the following page:


        Additionally, as mentioned in the link below, the Playback101 account processes orders immediately rather than simulating internet latency like the Sim101 account would:


        With this combination, I suspect that orders carried over into the next session might be taking bid/ask price fluctuations during the trading break into account and resulting in odd simulation fills that would not happen when trading on a live account.

        I look forward to your reply.
        Emily C.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by TradeSaber, Today, 10:11 PM
        0 responses
        10 views
        0 likes
        Last Post TradeSaber  
        Started by GreyKerns09, Today, 03:42 PM
        1 response
        13 views
        0 likes
        Last Post marco231  
        Started by marco231, 05-15-2024, 11:32 PM
        3 responses
        21 views
        0 likes
        Last Post marco231  
        Started by mrgreentrading, Today, 08:29 PM
        0 responses
        18 views
        0 likes
        Last Post mrgreentrading  
        Started by rbendson, Today, 08:18 PM
        0 responses
        4 views
        0 likes
        Last Post rbendson  
        Working...
        X