Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax


public PercentRank(DataSeries ds, int period, string description)
public static PercentRank Series(DataSeries ds, int period)

public PrcRank(DataSeries ds, int period, string description) public static PrcRank Series(DataSeries ds, int period)

Parameter Description

ds DataSeries
period Lookback period

Description

Returns percent rank of the current element of the DataSeries within all elements over the specified period. Matches Excel's function.

There exist 2 implementations: PercentRank courtesy DartBoardTrader (Michael Bytnar), PrcRank courtesy avishn (Andrew).

Example

The following example will compare the 2 implementations of PercentRank:

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

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { PercentRank pr = PercentRank.Series(Close,252); PrcRank pc = PrcRank.Series(Close,252); ChartPane p = CreatePane( 30,true,true ); PlotSeries( p, pr, Color.Red, WealthLab.LineStyle.Solid, 1 ); PlotSeries( p, pc, Color.Blue, WealthLab.LineStyle.Solid, 1 ); } } }

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.