Announcement

Collapse
No announcement yet.

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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        15 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        59 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        42 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        47 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        38 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X