**Syntax**

public UDIDSRI(DataSeries ds, int period, int power, int percentRankPeriod, int iteration, string description)
public static UDIDSRI(DataSeries ds, int period, int power, int percentRankPeriod, int iteration)

**Parameter Description**

*ds* | DataSeries |

*period* | Indicator lookback period |

*power* | Power to multiply absolute returns (use 1st to 5th) |

*percentRankPeriod* | Lookback period for Percent Rank (generally, use 50) |

*iteration* | One of the two "iterations" of the indicator (use 1 or 2). |

**Description**

Up/Down and Intensity Day Summation Rank (UDIDSRI) by

qusma.com is an indicator described by its author as

*impressively good at picking out bottoms, and has very strong 1-day and acceptable medium-term predictive power.*First iteration:

- If the day closes up, movement = 1, otherwise movement = -1.
- Sum movement over the last 20 days.
- UDIDSRI is the % rank of today’s sum, compared to the last 50 days of sums.

Second iteration:

- If the day closes up, movement = 1, otherwise movement = -1.
- Multiply movement by (1 +abs( return))5
- Sum the movements for the last 20 days.
- UDIDSRI is the % rank of today’s sum, compared to the last 50 days of sums.

**Interpretation**

The case that presents the most interest is when UDIDSRI is equal to zero (i.e. the lowest value in 50 days), where 50 is the

Percent Rank lookback period. Author stresses that since the the opposite approach (indicator hitting its maximum value) provides no edge either for mean reversion or trend following, it's useless for going short.

**Example**

This example illustrates plotting the UDIDSRI indicator, as well as buying a security after it hits 0, and exiting at a 10% trailing stop:

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

namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
UDIDSRI u = UDIDSRI.Series(Close,20,1,50,1);
ChartPane up = CreatePane(30,true,true);
PlotSeries(up,u,Color.FromArgb(255,255,0,0),LineStyle.Solid,2);

for(int bar = GetTradingLoopStartBar(1); bar < Bars.Count; bar++)
{
if (IsLastPositionActive)
{
Position p = LastPosition;
double high = p.MFEAsOfBar(bar) / p.Shares + p.EntryPrice;
double amount = high - high * (10 / 100.0d);
SellAtTrailingStop(bar + 1, p, amount);
}
else
{
if( u[bar] == 0 )
BuyAtMarket(bar+1);
}
}
}
}
}