AveragePriceC

Modified on 2008/04/18 09:50 by Administrator — Categorized as: Standard Indicators

Syntax

public AveragePriceC(Bars bars, string description) public static AveragePriceC Series(Bars bars)

Parameter Description

bars The Bars object

Description

See Calculation. See also: AveragePrice

Interpretation

AveragePriceC is used in the construction of other indicators such as KeltnerUpper, KeltnerLower, and MFI.

Calculation

AveragePriceC = (High + Low + Close) / 3

Example

Find and plot the % spread between the AveragePriceC of the clicked symbol and that of MSFT.

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() {

DataSeries avgC = AveragePriceC.Series(Bars); Bars xBars = GetExternalSymbol("MSFT", true); DataSeries xAvgC = AveragePriceC.Series(xBars); DataSeries spreadPct = 100 * (xAvgC/avgC - 1); spreadPct.Description = "% Spread"; ChartPane cp = CreatePane(40, true, true); PlotSeries(cp, spreadPct, Color.Blue, LineStyle.Histogram, 2); } } }