Search Framework:
HeikinAshi
Namespace: WealthLab.Core
Parent: Object

A static class that converts BarHistory data into a Heikin-Ashi version.

Members
Convert
public static BarHistory Convert(BarHistory bars)
public static BarHistory Convert(BarHistory bars, string smoother = "TEMA", int period = 21, string candleSmoothing = "Valcu")

Converts the BarHistory instanced passed in bars to the transformed Heikin-Ashi version. For more information on how Heikin-Ashi histories are calculated, see the Wikipedia entry. Use the overloaded parameters to create a Heikin-Ashi using smoothed OHLC. A name other than "Valcu " for the H-A close candle smoother will use the "Vervoort" formula.

Example Code
using WealthLab.Backtest;
using WealthLab.Core;

namespace WealthScript1
{
	public class MyStrategy : UserStrategyBase
	{
		//Initialize
		public override void Initialize(BarHistory bars)
		{
			BarHistory hk = HeikinAshi.Convert(bars);
			PlotBarHistory(hk, "HK");
		}

		//Execute
		public override void Execute(BarHistory bars, int idx)
		{
		}
	}
}