Here is what I want to do:
- Have multiple time frames and pass to a method OHLC and bar time for the main dataseries that I have on the chart, and for the 5 min dataseries that I am addding in the strategy?
- I have figured out that I need to do a private DateTimeSeries to get the bar time.... and set this in OnBarUpdate.... BUT this seems inefficient and bulky. I don't think that this is the right way to do this to pass data to a method.
- Please advise on the best practices way to pass OHLC and bar times (the close of the bar time) to methods outside of OnBarUpdate
private DateTimeSeries myDateTimeSeries; // Define a DateTimeSeries variable
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
EntryHandling = EntryHandling.UniqueEntries;
Add(PeriodType.Minute, 5);
myDateTimeSeries = new DateTimeSeries(this, MaximumBarsLookBack.Infinite);
}
protectedoverridevoid OnBarUpdate()
{
// Store the current time that we will pass in to the functions for capturing the bar times
myDateTimeSeries.Set(Time[0]);
mynewmethod (myDateTimeSeries, <how to pass dataseries on chart for 5 min OHLC and bar time?>, <how to pass dataseries for 5 min OHLC and bar time?>
}
Comment