Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Start Date of a Strategy?

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

    Start Date of a Strategy?

    If I run my strategy, it starts "in between" but which date is chosen as the start date by default and how can I adjust this date?

    Is it the maximum bars lookback? Or the minimum bars required to trade?

    #2
    Hello pmmkm,

    Thanks for your post.

    Unless you have otherwise instructed the strategy through coding, the strategy will process historical bars starting at the very first bar of the historical data set as defined by the data series "days (or bars) to load". To clarify, if you have a data series of 5 days to load then the strategy will begin processing the data from 5 days ago.

    In terms of when it places its first trade, the parameter "Bars required to trade" will prevent entries until that number of bars has been processed by the strategy.

    If you do not wish the strategy to place historical trades you can add the following statement at the top of the OnBarUpdate():

    if (State != State.Realtime) return; // Only process on real time data.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    93 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    138 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    123 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    73 views
    0 likes
    Last Post PaulMohn  
    Working...
    X