Your interactive trading laboratory!
 • 
8 users online

BarHistory Object out of a TimeSeries

In an indicator development case, I need to have a BarHistory Object next to a TimeSeries Object. How can I generate this from a TimeSeries? I went through the complete TASC Library but could not find any relevant samples...

public override void Populate()
{
    TimeSeries source = Parameters[0].AsTimeSeries;
    int maPeriod = Parameters[1].AsInt;
    int period = Parameters[2].AsInt;

    AdvancedSmoothers.VWMA vwma = new AdvancedSmoothers.VWMA(source, maPeriod, bars);
Attachment

Cancel

Responses

VWMA requires a Volume series. It should be meaningful or you risk getting GIGO (garbage in garbage out). You should add a BarHistory as a parameter to your indicator and pass it on to the VWMA instance.

VWMA requires a Volume series. It should be meaningful or you risk getting GIGO (garbage in garbage out). You should add a BarHistory as a parameter to your indicator and pass it on to the VWMA instance.

Just realized the same right now that a BarHistory object must be added as an additional parameter set. Thanks anyway!

Just realized the same right now that a BarHistory object must be added as an additional parameter set. Thanks anyway!
Forum Tips

Please sign in if you want to participate in our forum.

Our forum uses Markdown syntax to format posts.

To embed code snippets, enclose them in [CODE][/CODE] tags.