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 helpwanted, Today, 03:06 AM
        0 responses
        3 views
        0 likes
        Last Post helpwanted  
        Started by Brevo, Today, 01:45 AM
        0 responses
        6 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X