- ago
using WealthLab.Backtest;
using System;
using WealthLab.Core;
using WealthLab.Indicators;
using System.Collections.Generic;
using WealthLab.Indicators;

namespace WealthLab
{
public class MyStrategy : UserStrategyBase
{
//create indicators and other objects here, this is executed prior to the main trading loop
public override void Initialize(BarHistory bars)
{
indicator = new VWAP(bars,930);
PlotIndicator(indicator);
}

//execute the strategy rules here, this is executed once for each bar in the backtest history
public override void Execute(BarHistory bars, int idx)
{
}

//declare private variables below
private VWAP indicator;
}
}
0
51
4 Replies

Reply

Bookmark

Sort
- ago
#1
Should it work using daily bars ?
0
- ago
#2
QUOTE:
Should it work using daily bars?

No it shouldn't. It only works with intraday bars. The main stream WL VWAP indicator is strictly for intraday trading.

There is an anchored version of VWAP where you can set the start date. You can compile it on Visual Studio. https://www.wealth-lab.com/Discussion/Anchored-VWAP-indicator-10356#post20
0
- ago
#3
Thank you.
The anchored VWAP can work on both daily and intraday bars
0
- ago
#4
QUOTE:
The anchored VWAP can work on both daily and intraday bars.

I didn't know that. Thanks for pointing that out.

I mistakenly thought the anchored VWAP was available as a Community indicator, but looking in that indicator folder now I don't see it there. But you can compile it with Visual Studio and place it in your own local.components.dll library for "WL8 Projects".
0

Reply

Bookmark

Sort