1. Home
2. ThinkorSwim Indicators
3. Oliver Velez Trading Bands for ThinkorSwim

# Oliver Velez Trading Bands for ThinkorSwim

This is a simple day trading indicator, as explained by Oliver Velez. It uses the previous day’s high, low, and close in addition to the daily 20-period moving average.

• Assume the trend is bullish when the stock price crosses above the upper band (green).
• Assume the trend is bearish when the stock price crosses below the lower band (red).

## Oliver Velez Trading Bands for ThinkorSwim

```#Indicator Name: Oliver Velez Trading Indicator
#Version: 1.0.0
#Developer: Melvin C.
#Based on hs-sahota script
def agg_period = AggregationPeriod.DAY;
def data = close(period = agg_period);
input length = 20;
def p20ma = Average(data, length);
def phigh = high(period = agg_period)[1];
def plow = low(period = agg_period)[1];
def pclose = close(period = agg_period)[1];
def highTower1 = if pclose >= p20ma then pclose else p20ma;
def lowGround1 = if p20ma < pclose then p20ma else pclose;
def highTower = if phigh >= highTower1 then phigh else highTower1;
def lowGround = if plow < lowGround1 then plow else lowGround1;
plot upper = highTower;
plot lower = lowGround;
upper.AssignValueColor(Color.Green);
lower.AssignValueColor(Color.Red);
```

The 20 SMA (simple moving average) indicator calculates the average price of an asset over the last 20 periods.

This moving average can be used to determine the general trend as well as potential areas of support and resistance.

## Unlock the Power of ThinkorSwim

Get the latest news and updates on TD Ameritrade, ThinkorSwim indicators, thinkScript tutorials, and trading strategies delivered straight to your inbox every week.

We don’t spam! Unsubscribe at anytime.