HasCrossedBelow


Summary

Returns true, if dataseries1 has crossed below dataseries2, over the specified Period.

Remarks

HasCrossedBelow will compare the crossing dataseries to the crossed dataseries starting from the current value of the series going back the specified period. If period is zero only the current bar values will be compared. If period is one the current bar values will be compared as well as the previous. e.g. Functions.HasCrossedBelow(sma.Result, MarketSeries.Close, 0) will only compare the current values which are not completed until the close of the bar. It is not uncommon that the function will return true and by the end of the bar the two series will uncross.

Syntax

public static bool HasCrossedBelow(DataSeries crossingSeries, DataSeries crossedSeries, int period)
public static bool HasCrossedBelow(DataSeries crossingSeries, double value, int period)

Parameters

NameDescription

Example 1

public override void Calculate(int index)
{
    if(Functions.HasCrossedBelow(sma.Result, MarketSeries.Close,0)
    {
        //Do something
    }
    // May be invoked as an extension method
    
    if(sma.Result.HasCrossedBelow(MarketSeries.Close, 0))
    {
        //Do something
    }
}