Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimize performance (BarsArray vs BarsinProgress)

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

    Optimize performance (BarsArray vs BarsinProgress)

    Hi,

    Trying to optimize a strategy, but it is taking a crazy amount of time! 10hrs and no idea of how much to run.

    I am running it on 5min data, but in it i reference tick data. I have a question on the most optimal way of referencing tick(or any finer period) data.

    If i were to use barsinprogress =1 to reference the tick data, and then apply decisions under that and reference back to the 5min data using barsarray[0], then i'd expect that to be a lot slower than say using the normal barsinprogress and then just using barsarray[1] when i need to to get the tick info. Correct?

    Cheers

    Example

    If i have the below running on 5min....
    But i want the close to be the very tick it crosses the SMA, and not wait for a 5min bar to close above it. Then which is faster processing?

    Option A

    Add(PeriodType.Tick,1);

    if (Closes[1][0] >= SMA(50)[0])
    {
    Enter Long(100);
    }

    Option B


    Add(PeriodType.Tick,1);

    if (BarsInProgress ==1)
    {
    if (Close[0] >= SMA(BarsArray[1],50)[0])
    {
    Enter Long(100);
    }
    }

    #2
    Aussiemike, this would first of all a question if those would be really equivalents for your strategy, since Option A would not be filtered for any BarsInProgress context but be called therefore in BIP 0 and 1. Since you process the tick series in both cases for all ticks I would not expect much calculation difference, since the 5 min calls could be neglected in comparison to tick processing.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    61 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    39 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X