Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtests with first execution/purchase?

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

    Backtests with first execution/purchase?

    Hello, love the product, it's very fast and seems very robust.

    Having an issue, however, running some simple backtests for some indicies utilizing Exponential Moving Averages and specific time frames. For example, I have the timeframe for 01-02-1990 to 06-22-2010, and another for 01-03-2000 to 06-22-2010.

    The if/then scenarios I have are, when X EMA crosses above X EMA, enter long position, and vice versa for crosses below.

    When I run the backtest, though, times of buys/sells/executions don't seem to be adding up, and for benchmarking/buy and hold comparison, how can I get the first trade to go in on 01-02-1990 and 01-03-2000, respectively?

    #2
    Hello Jttom,

    Welcome to the NinjaTrader forums!

    Let us know what you're seeing with times of buys/sells/executions don't seem to be adding up.

    It may be helpful to add TraceOrders = true; to your initialize statement. You can then view strategy order information through Tools > Output Window.

    If you want to base entries on a specific day you can use ToDay(Time[0]). More information on manipulating DateTime objects is available with this reference sample.
    Last edited by NinjaTrader_RyanM1; 06-29-2010, 01:24 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      TraceOrder? (solved)

      Hi,

      When I put TraceOrder = true; in my Initialize section I get a compile error. It says that TraceOrder does not exist in the current context. What do I need to do to get TraceOrder to work? This is true for V6.5 and V7.

      Found the problem, it's TracerOrders, not TraceOrder (although I'm pretty sure that's what I saw in a few different posts, double checked it a few times).

      Thanks,
      Ian
      Last edited by Owlman; 06-25-2010, 11:29 PM.

      Comment


        #4
        Hello Owlman,

        Its sound like after the typo was corrected, your script is running properly. Please let us know if this is not the case.

        In case it’s of interest, this is the link for TraceOrders item in the NinjaTrader 6.5 Help Guide.


        Please let us know if we can answer any additional questions.
        ChipNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        48 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        66 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X