Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

public LowestBar(DataSeries source, int period, string description)
public static LowestBar Series(WealthLab.DataSeries source, int period)
public static double Value(int bar, DataSeries source, int period)

Parameter Description

source The source DataSeries
period Lookback period

Description

Returns the bar in which lowest value of the source DataSeries for the specified period was recorded.

See Highest for more information.

Remarks

  • If more than one bar has precisely the same Lowest value, then LowestBar returns the most recent bar, i.e., the bar with the latest date/time.
  • See LowestBar2 in TASCIndicators to return the LowestBar having the earliest date/time.

Calculation

Looks back the specified number of periods from the specified Bar and returns the Bar number with lowest price within that Period.

Example

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() { /* Color areas of the chart where the 200 day low has occurred within the past 20 bars */ double n = 0; for(int bar = 200; bar < Bars.Count; bar++) { n = LowestBar.Value( bar, Low, 200 ); if( bar - n <= 20 ) SetBackgroundColor( bar, Color.FromArgb(255, 227, 231) ); } } } }

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.