Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Tested strategies: REPLAY, HISTORICAL, LIVE, ANALYZER

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

    Tested strategies: REPLAY, HISTORICAL, LIVE, ANALYZER

    hello i need help

    I am creating a strategy for anchorage tests, for that I need to limit stop loss and of course get results.

    is a strategy in joining-up graphs with a simple pattern of 4 red bars and 1 green bar (I share screenshot)

    but my problem comes when I analyze my strategy in HISTORICAL or with the strategy analyzer gives me very good results, but it calculates me in closed bar if you look at the image I should buy in the blue background bar and buy or sell in the next one. which is a problem because I lose ticks that could become take profit.(2ticks x bar)

    but that's not all, the worst thing is that when I put the strategy in the replay or live with the same configuration and same days the results in replay and live are disastrous.

    But this does not end here ... no matter if you use strategies in TICKS, TIME, UNIRENKO ... that you use sailing patterns or any other indicator all happen the same give good results in historical and analyzer, but in replay and live is regrettable results.

    that you calculate in historical and it is not exact I can understand it... but that a strategy analyzer tells you and tests which is the best combination for the best results you try it in replay or live and the results are totally the opposite

    my question is.... is there any way to tell the analyzer or that to calculate the history as it is really ordered in the conditions? because if I put calculating by brand it doesn't work either

    I personally would like to see that if I create a strategy and tell you buy here that you show me where you buy not the candle later because the results are already worthless.

    or know how I should make strategies as I calculate the analyzer and hit at least 90% but not even that....
    Attached Files

    #2
    Hello JesusSanchez,

    Thank you for your post.

    You should expect that a strategy running real-time (live brokerage account, live market simulation, Market Replay etc...) will produce different results than the performance results generated during a backtest using the Strategy Analyzer. This difference may be more easily seen on certain Bars types (e.g. Point and Figure, Renko) than others due to their inherent nature in bar formation.

    During a backtest you can select conservative or liberal fill algorithms which will produce different results. Fills are determined based on 4 data points, OHLC of a bar since that is the only information that is known during a backtest and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.

    Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick'.

    Also, here is a link to the differences on real-time vs backtest (historical).
    http://ninjatrader.com/support/helpG...ime_vs_bac.htm

    Adding intra-bar granularity can help with this.

    Intra-bar granularity adds a second data series such as a 1 tick series so that the strategy has finer granularity in the historical data in between the OHLC of the primary series. This allows for more accurate trades by supplying the correct price at the correct time for the order to fill with.

    In NinjaTrader 8, there have been two new enhancements so that programmers do not have to manually add this secondary series and code the script to for high accuracy fills (Order Fill Resolution) and for intra-bar actions (TickReplay).

    Here is a link to our forums that goes into depth on using Order Fill Resolution and Tick Replay to ensure your backtests are as close to real time results as possible:

    https://ninjatrader.com/support/foru...mance?t=102504

    High Fill Order Resolution and TickReplay cannot be used together. If it is necessary to have both, it is still possible to add intra-bar granularity to a script in the code itself for order fill accuracy and use TickReplay to update indicators with Calculate set to OnPriceChange or OnEachTick historically.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      If I understand you correctly, ...., I have to put additional data from 1 stick in my strategy.
      Attached Files

      Comment


        #4
        Hello JesusSanchez,

        Thank you for your reply.

        If you go the route of adding a single tick data series to your strategy you'd need to unlock your code and manually add logic so you can actually submit orders to the secondary series. The Strategy Builder will not allow you to submit orders to a secondary added series - you can only use the secondary series for indicator calculations in the Builder.

        Here is an example from our help guide that demonstrates submitting orders to a secondary data series:



        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jeronymite, 04-12-2024, 04:26 PM
        2 responses
        29 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Mindset, 05-06-2023, 09:03 PM
        10 responses
        263 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by michi08, 10-05-2018, 09:31 AM
        5 responses
        742 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by The_Sec, Today, 02:29 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by tsantospinto, 04-12-2024, 07:04 PM
        4 responses
        63 views
        0 likes
        Last Post aligator  
        Working...
        X