Log in to see Cloud of Tags

Wealth-Lab Wiki

Bar Patterns



public bool isInsideBar(int bar)
public bool isOutsideBar(int bar)
public bool isGapUp(int bar)
public bool isGapDown(int bar)

public enum GapType { PartialDown, FullDown, PartialUp, FullUp }
public GapType isGap(int bar)

Parameter Description

bar Bar number


  1. A collection of functions to detect simple bar patterns: Inside Day, Outside Day, Gap Up and Gap Down.
  2. An alternative isGap function returns an enumeration GapType, indicating the type of gap - up/down, full/partial.


Example using C# extension methods:

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

namespace WealthLab.Strategies { public class BarPatternsDemo : WealthScript { protected override void Execute() { for(int bar = 1; bar < Bars.Count; bar++) { if( this.isGapUp(bar) && this.isGap(bar) == CommonSignalsEx.GapType.FullUp ) AnnotateBar( "Gap Up", bar, true, Color.Blue ); if( this.isGapDown(bar) && this.isGap(bar) == CommonSignalsEx.GapType.FullDown ) AnnotateBar( "Gap Down", bar, false, Color.Red); } } } }

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.