Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

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

Parameter Description

source Price series
period Indicator calculation period

Description

CumUp lets you test whether a specific number of consecutive bars have elapsed where the prices are greater than their value a certain number of bars ago. See also: CumDown

Calculation

CumUp is a running count of the number of bars whose Series value is above its delayed Series; in other words, Series offset forward by the Period. The count is reset to zero when the Series is below its offset series.

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 { // Thank you fundtimer public Color WS4ColorToNET( double WS4Color ) { return Color.FromArgb( (int)Math.Floor( ( WS4Color % 1000 ) / 100 * 28.4 ), (int)Math.Floor( ( WS4Color % 100 ) / 10 * 28.4 ), (int)Math.Floor( WS4Color % 10 * 28.4 ) ); } protected override void Execute() { // Highlight extreme moves up

double n = 0; for(int bar = 0; bar < Bars.Count; bar++) { n = Math.Truncate( CumUp.Series( Close, 3 )[bar] ); if( n > 9 ) n = 9; SetBarColor( bar, WS4ColorToNET( n*10 ) ); } } } }

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.