Syntax
public Highest(DataSeries source, int period, string description)
public static Highest Series(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 highest value of a
source DataSeries within the specified lookback
period.
Highs and lows are found in all markets, and, they are fundamentally important to technical analysis. Uptrends are defined by a succession of higher highs and higher lows, whereas downtrends are characterized by a succession of lower highs and lower lows. Support and resistance is often defined at significant high and low points. Pattern formations are shaped by highs and lows such as double tops and bottoms, head and shoulder formations, rectangles, triangles, flags, consolidations and other formations. Use Wealth-Lab functions: Highest, Lowest, HighestBar and LowestBar, for finding and analyzing these market opportunities.
Interpretation
- Uptrends are formed by a succession of higher highs and higher lows, failure to make a new higher high or higher low means the trend has ended.
- Downtrends are formed by a succession of lower highs and lower lows failure to make a new lower high or lower low means the trend has ended.
- Divergence occurs when price action and indicators move in different directions and commonly occur before a stock or a market changes direction. During an uptrend, if a new high appears in the price action and a lower high develops in the indicator, then the trend maybe ending. See RSI for more information on divergence.
- Useful for stop loss calculations such as when taking short positions, or buy order triggers. Add an amount to the last highest value, this can be a fixed amount like a percentage of current closing price. A better method is to allow for volatility, use a multiple of ATR for this. For example, Highest high plus, half times ATR of last 20 bars.
- Entry filters, buy if today prices is higher than high for past two days. This can be useful to ensure you start your trade in the right direction.
- Past highs can represents significant resistance to price action. Look for single or multiple highs forming at both technical and psychological levels. (Gann, Fibonacci, whole numbers, and the like).
- Many chart patterns are defined by recent high and lows.
Calculation
Looks back the specified number of periods from the specified Bar and returns the highest 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()
{
// Have we made a 100 bar high?
for(int bar = 100; bar < Bars.Count; bar++)
{
if( High[bar] == Highest.Series( High, 100 )[bar] )
AnnotateBar( "NH", bar, true, Color.Black );
}
}
}
}