Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting and live (paper) trades are different

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

  • NinjaTrader_Jason
    replied
    @ mart331, could you perhaps start a new thread as per these inquiries. Unfortunately I am not a programmer and very knowledgable with NinjaScript - I cannot comment on this. It would more clear for the thread itself as well, since multiple users post in here.

    @ dave1992, yes unfortunately there is no conversion. I will forward your feedback to my superiors.

    Leave a comment:


  • dave1992
    replied
    Originally posted by NinjaTrader_Jason View Post

    @ mart331, unfortunately the Strategy Analyzer can only display currency values in US dollar. For example, the FDAX is set to Euro in the Instrument Manager. However when performing a backtest, the profit or loss in Euro will be reflected in US dollar. Please note that this is an absolute conversion - 1 Euro = 1 US dollar.
    There's not even a conversion is there? Backtest doesn't know anything about currencies and just displays numbers. In fact, most of Ninja doesn't do currencies properly does it? If I have a live trade in FGBL and a live trade in YM a 20 euro profit will be displayed as 20 dollars and would be added to the dollar trade to give a completely incorrect total in dollars.

    In fact, proper multi currency support rather than a slightly implemented approach has been a suggestion for well over two years. See this thread

    Leave a comment:


  • mart331
    replied
    Originally posted by NinjaTrader_Jason View Post
    @ RedEye, unfortunately there are no intra bar calculations when performing backtests in the Strategy Analyzer. Only the OHLC values are used.

    @ mart331, unfortunately the Strategy Analyzer can only display currency values in US dollar. For example, the FDAX is set to Euro in the Instrument Manager. However when performing a backtest, the profit or loss in Euro will be reflected in US dollar. Please note that this is an absolute conversion - 1 Euro = 1 US dollar.
    Please also reply to my earlier post. Thanks

    Leave a comment:


  • NinjaTrader_Jason
    replied
    @ RedEye, unfortunately there are no intra bar calculations when performing backtests in the Strategy Analyzer. Only the OHLC values are used.

    @ mart331, unfortunately the Strategy Analyzer can only display currency values in US dollar. For example, the FDAX is set to Euro in the Instrument Manager. However when performing a backtest, the profit or loss in Euro will be reflected in US dollar. Please note that this is an absolute conversion - 1 Euro = 1 US dollar.

    Leave a comment:


  • mart331
    replied
    by the way, the results show profit in $, that should be euro's.

    Leave a comment:


  • RedEye
    replied
    Originally posted by NinjaTrader_Jason View Post
    Hello mart331,

    When performing a backtest the indicator values are only known at the close of a bar. While running a strategy in real-time, indicator values are calculated intra bar (Calculate on bar close = False).

    Could this be the cause of the discrepancy?
    If I'm using tick data and the price is based on the Bid, is there anyway I can have the indicator values calculated interbar?

    Leave a comment:


  • mart331
    replied
    Unfortunately, I work this way. But I can prove it to you something is wrong.

    As you can see in the image,

    I add 2 bartypes;
    I enter long/short on barsarray == 1 (based on values of barsarray ==2)
    So, the tradelogic does NOT have anything to do with the main chart.

    In optimize, I ONLY optimize on dataserie, in this case from 1 to 5 minutes,
    and you see the differences.... (period = 6 weeks)
    from 700 to 10.000 profit

    In my view all must be the same.
    None of these results equal by far the replay results.
    Attached Files

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    mart331,

    The best example we have for this is this reference sample:
    Backtesting NinjaScript Strategies with an intrabar granularity


    There will always be differences between a backtest and running a strategy live.

    Leave a comment:


  • mart331
    replied
    Originally posted by mart331 View Post
    As far as I can see:

    Backtest:
    If your master chart is a 5 minute Kagi chart, but you trade (in strategy) on a 10 second chart (by Add ( second,10), you get enter/exit values from Kagi chart, NOT the 10 second chart values, IS THIS THE CASE? (it should NOT)
    I tried to workaround this, by adding 5 minute Kagi chart (AddKagi()) and 10 second master chart, but this also gives very different values compared to replay, a loss instead of 5000 euro profit in replay (6 weeks).

    The problem can be the indicator. Because my entry/exit depends on 5 min Kagi, the indicator must use the Kagi data.
    Now i use:
    if (BarsInProgress == 1)
    {
    if (Indicator(...) == 1)
    enterTrade()
    }

    I tried (dont know anymore in backtest or Replay) to use Indicator(barsArray[1]), but that gave the same results as in above example.

    Tell me if I am doing wrong!
    Last edited by mart331; 11-16-2010, 03:09 PM.

    Leave a comment:


  • mart331
    replied
    As far as I can see:

    Backtest:
    If your master chart is a 5 minute Kagi chart, but you trade (in strategy) on a 10 second chart (by Add ( second,10), you get enter/exit values from Kagi chart, NOT the 10 second chart values, and that are barCLOSE or barOPEN values, IS THIS THE CASE? (it should NOT)
    Last edited by mart331; 11-16-2010, 01:33 PM.

    Leave a comment:


  • mart331
    replied
    no, i use calculateonbarclose=true.
    i think and test further.... For now i think all my backtesting and optimation efforts were useless

    Leave a comment:


  • NinjaTrader_Jason
    replied
    Hello mart331,

    When performing a backtest the indicator values are only known at the close of a bar. While running a strategy in real-time, indicator values are calculated intra bar (Calculate on bar close = False).

    Could this be the cause of the discrepancy?

    Leave a comment:


  • mart331
    replied
    Hello, I have another thought on this issue, having the same problem with majoor differences.
    I do now test my strategies in replay
    Can it be that the indicator values differ a lot? is their data filled in advance with replay and/or backtest?

    Leave a comment:


  • NinjaTrader_Jason
    replied
    @Camdo, I will forward your suggestion to prevent data being overwritten and only fill missing bars to Development to put it on the list of future considerations of the software. Thank you for your feedback.

    @dave1992, there can be minor discrepancies between real-time data and historical data with Zen-Fire in NinjaTrader 6.5.

    Zen-Fire does not provide historical data. As a courtesy, we allow Zen-Fire users to make use of our historical data server. Please see the following forum thread.


    As per post 7, data is aggregated differently as per the historical data server. The historical server is based off of NT 6.0 which agreggates tick data into minute bars based on 00:00:01 through 00:00:00. We changed this in NT 6.5 client so minute bars are created from ticks using 00:00:00 through 00:00:59. Thus, if you re-load data you can get subtle differences since there are two difference minute bar compression schemes used.

    NinjaTrader 7 is not affected, since its historical data server uses the same compression scheme as the client.

    Leave a comment:


  • dave1992
    replied
    Couple of points - if data is being changed, presumably it's with data that's more accurate? Secondly, you can avoid any reload by not being connected to your provider when you run the backtest.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
637 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
366 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
107 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
569 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
571 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X