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

Back Test Speed

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

    Back Test Speed

    Tonight I made a copy of one of my strategies and added the following code, which changed the backtest speed of the same amount of iterations from 3 minutes to 45 minutes.
    What am I missing here? Can't figure out why this creates a drastic slow down.

    Code:
    if ( Position.MarketPosition == MarketPosition.Long
    && BarsSinceEntryExecution(0,"LongEntry",0) >= 2 //test this period
    && Closes[1][0] > exPriceLong + (ticksOverEntry2*TickSize))
    {
    CancelOrder(stopOrderLong1a);
    stopOrderLong1b = ExitLongStopMarket(1, true, (lotLong*2), stopLong1b,"StopExitLong1b", "LongEntry");
    }

    #2
    hi
    try to use parentheses. it seems to me the last line in if() is not correct
    Code:
    [FONT=Courier][COLOR=#252c2f]if (
            Position.MarketPosition == MarketPosition.Long
         && BarsSinceEntryExecution (0, "LongEntry", 0) >= 2
         && Closes[1][0] > (exPriceLong + (ticksOverEntry2 * TickSize))
    )[/COLOR][/FONT]

    Comment


      #3
      Thanks for the attempt Danila.
      Unfortunately this is not the issue.

      Comment


        #4
        Hello mlprice12,

        I don't specifically see what may make the test longer based on only that part of the code. Are you seeing that many more orders are being submitted/cancelled or any notable change in the results?

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        40 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        11 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,615 views
        0 likes
        Last Post aligator  
        Working...
        X