Log in to see Cloud of Tags

Wealth-Lab Wiki




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

Parameter Description

bars The Bars object


See Calculation. See also: AveragePriceC


AveragePrice represents the average price between the High and Low of a bar.


AveragePrice = (High + Low) / 2


Find and plot the % spread between the AveragePrice 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 avg = AveragePrice.Series(Bars); Bars xBars = GetExternalSymbol("MSFT", true); DataSeries xAvg = AveragePrice.Series(xBars); DataSeries spreadPct = 100 * (xAvg/avg - 1); spreadPct.Description = "% Spread"; ChartPane cp = CreatePane(40, true, true); PlotSeries(cp, spreadPct, Color.Blue, LineStyle.Histogram, 2); } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.

ScrewTurn Wiki. Some of the icons created by FamFamFam.