Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding minute and daily data to a strategy

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

    Adding minute and daily data to a strategy

    Hi,
    I'm creating an intraday strategy using minute data. I also want to be able to use values from the previous day (ie: open, close, etc of previous day).

    In the initialise function for the strategy, i use:

    Add(PeriodType.Minute, 3);
    Add(PeriodType.Minute, 20);
    Add(PeriodType.Day, 1); // doesn't work with this line inserted

    I run the strat with 1min bars selected in the strat options.
    I access the different data for different timeframes the usual way,
    eg: Closes[1][0] (for say the 3 minute data).

    If i put in the 3rd add as above, to add the daily data (i would presume), the strategy doesn't run through. I don't get any error in the log output. Strategy appears to run, but if I put any debug "Print" statements in to see if it's cycling through each "onbarupdate" call, i don't get any output in the output window.
    I'm assuming there's some kind of error but it's not reporting it.

    I'm wanting to be able to access data from the previous day, so can do calls such as:
    Closes[3][1] for example
    or current daily data (eg high of current day):
    Highs[3][0]

    thanks
    daniel

    #2
    Maybe you just don't receive daily data. Can you see any bar when you open a chart with the interval set to 1 Day bars? If you can't see any bar you can still access daily data by using the interval 1440 Minute bars.

    The prior days OHLC can be easily accessed with the PriorDayOHLC indicator.

    Regards,
    Daniel

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    368 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    571 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X