Volume Price Analysis (VPA) Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Here is the Volume Price indicator for ThinkorSwim converted from NinjaTrader's VPA. Since there are several differences between the two platforms, some features and labels might be different. Please read the whole log below before using it.

This is a conversion of the NinjaTrader VPA indicator. ToS does not support directional triangles and diamonds, so there are some differences. The triangles are left as is, just not pointing a specific direction. The diamonds have been replaced with circles.

C_RP Original notes by cbritton are above. Changes made after 20100722 by Richard Paske are marked below by the C_RP comment tag. A few bugs were fixed. More significantly, the color scheme for symbols was changed radically in an attempt to map directional strength to hue based on the ROYGBIV color spectrum. In addition, a symbol's shape and its vertical position above or below a candle now imparts added meaning to it. In general, the strength of a symbol is assigned by its color and shape in that order. In certain circumstances a symbol's vertical offset from its candle's top or bottom strengthens the symbol's meaning. The symbol strength hierarchy is defined as follows:

1. Color: Symbols below candles are assigned strength from weakest to strongest in this order: white (or grey), cyan (blue/green), green. A red symbol under a candle indicates the failure of the symbol attached below the candle immediately preceding it.

Symbols above candles are assigned strength from weakest to strongest in this order: yellow, orange, red. A green symbol above a candle indicates the failure of a symbol attached above the candle immediately preceding it. A magenta (pinkish purple) square above a candle is a special case indicating Distribution. Another special case for testing purposes as of 20100830 is a white triangle high above a candle indicating a Gravestone Doji.

Symbols drawn on the middle of a candle are of two types with one variation. A green circle indicates Effort to Move Up on up bars. A magenta (pinkish purple) circle indicates Effort to Move Down on down bars except for red down bars on which magenta displays poorly. In order to be seen easily, yellow circles indicate Effort to Move Down on red down bars.

2. Shape: A symbol of a given color is assigned increasing strength according to this hierarchy (from low to high): circle, square, triangle, downward or upward arrow. In certain circumstances two symbols of the same shape and color will be stacked vertically, adding strength through the combined symbols. Occasionally, two different symbols will be stacked vertically because that candle satisfies the criteria for two indications.

Listed below are the symbols and their meanings. The original symbol chart can be found at the end of this study.

Symbols Below Candles

White Square - Test for Supply
Cyan Circle - No Supply
Cyan Triangle - Successful Test for Supply
2 Cyan Triangles - Successful Test for Supply 2
Grey Square - Test for Supply in Uptrend
Green Circle - Stopping Volume
Cyan Square - Strength in Downtrend
Green Square - Strength in Downtrend 1
Green Triangle - Strength in Downtrend 2
Green UpArrow - Strength Confirmation Bar
2 Green UpArrows - Strength Confirmation Bar with High Close
Red Square - Failed Strength Signal

Symbols in the Middle of Candles

Green Circle - Effort to Move Up
Magenta Circle - Effort to Move Down
Yellow Circle - Effort to Move Down on Red Down Candles

Symbols Above Candles

White Triangle - Gravestone Doji (included as an experiment as of 20100830 to test its usability in the UpThrust category)
Yellow Triangle - Weakness
Orange Circle - No Demand
Orange Square - PseudoUpThrust
Orange Triangle - PseudoUpThrust Confirmation
Red Square - UpThrust
Red Triangle - Confirmed UpThrust Condition 1
Red DownArrow - Confirmed UpThrust Condition 2 or 3
Green Square - Failed UpThrust or PseudoUpThrust Confirmation
Red Circle - Reversal Likely
Magenta Square - Distribution
Magenta Triangle - Two or Three Period UpThrust
C_RP The next two comments are from the original comments by cbritton.

The NT version used a LinRegSlopeSFX indicator for determining trends. Those have been replaced in this ToS version with a call to the built in LinearRegressionSlope indicator.

Changes made after 20120922 by Glenn Kaler are marked below by the C_GK comment tag. C_GK TOS removed AddChartLabel and replaced it with AddLabel. Rationale: Using "Chart" in AddChartLabel was unnecessary since this function only relates to charts.

thinkScript Code

Rich (BB code):
# This is a conversion of the NinjaTrader VPA indicator.  ToS does not support directional

# triangles and diamonds, so there are some differences.  The triangles are left as is, just

# not pointing a specific direction.  The diamonds have been replaced with circles.



# C_RP Original notes by cbritton are above. Changes made after 20100722 by Richard Paske are marked below by the C_RP comment tag. A few bugs were fixed. More significantly, the color scheme for symbols was changed radically in an attempt to map directional strength to hue based on the ROYGBIV color spectrum. In addition, a symbol's shape and its vertical position above or below a candle now imparts added meaning to it. In general, the strength of a symbol is assigned by its color and shape in that order. In certain circumstances a symbol's vertical offset from its candle's top or bottom strengthens the symbol's meaning. The symbol strength  hierarchy is defined as follows:



# 1. Color: Symbols below candles are assigned strength from weakest to strongest in this order: white (or grey), cyan (blue/green), green. A red symbol under a candle indicates the failure of the symbol attached below the candle immediately preceding it.

# Symbols above candles are assigned strength from weakest to strongest in this order: yellow, orange, red. A green symbol above a candle indicates the failure of a symbol attached above the candle immediately preceding it. A magenta (pinkish purple) square above a candle is a special case indicating Distribution. Another special case for testing purposes as of 20100830 is a white triangle high above a candle indicating a Gravestone Doji.

# Symbols drawn on the middle of a candle are of two types with one variation. A green circle indicates Effort to Move Up on up bars. A magenta (pinkish purple) circle indicates Effort to Move Down on down bars except for red down bars on which magenta displays poorly. In order to be seen easily, yellow circles indicate Effort to Move Down on red down bars.



# 2. Shape: A symbol of a given color is assigned increasing strength according to this hierarchy (from low to high): circle, square, triangle, downward or upward arrow. In certain circumstances two symbols of the same shape and color will be stacked vertically, adding strength through the combined symbols. Occasionally, two different symbols will be stacked vertically because that candle satisfies the criteria for two indications.

# Listed below are the symbols and their meanings. The original symbol chart can be found at the end of this study.

# ___Symbols Below Candles___

# White Square - Test for Supply

# Cyan Circle - No Supply

# Cyan Triangle - Successful Test for Supply

# 2 Cyan Triangles - Successful Test for Supply 2

# Grey Square - Test for Supply in Uptrend

# Green Circle - Stopping Volume

# Cyan Square - Strength in Downtrend

# Green Square - Strength in Downtrend 1

# Green Triangle - Strength in Downtrend 2

# Green UpArrow - Strength Confirmation Bar

# 2 Green UpArrows - Strength Confirmation Bar with High Close

# Red Square - Failed Strength Signal
# ___Symbols in the Middle of Candles___

# Green Circle - Effort to Move Up

# Magenta Circle - Effort to Move Down

# Yellow Circle - Effort to Move Down on Red Down Candles

# ___Symbols Above Candles___

# White Triangle - Gravestone Doji (included as an experiment as of 20100830 to test its usability in the UpThrust category)

# Yellow Triangle - Weakness



# Orange Circle - No Demand

# Orange Square - PseudoUpThrust

# Orange Triangle - PseudoUpThrust Confirmation



# Red Square - UpThrust

# Red Triangle - Confirmed UpThrust Condition 1

# Red DownArrow - Confirmed UpThrust Condition 2 or 3

# Green Square - Failed UpThrust or PseudoUpThrust Confirmation



# Red Circle - Reversal Likely

# Magenta Square - Distribution

# Magenta Triangle - Two or Three Period UpThrust


# C_RP The next two comments are from the original comments by cbritton.

# The NT version used a LinRegSlopeSFX indicator for determining trends. Those have been

# replaced in this ToS version with a call to the built in LinearRegressionSlope indicator.

# Changes made after 20120922 by Glenn Kaler are marked below by the C_GK comment tag.

# C_GK TOS removed AddChartLabel and replaced it with AddLabel. Rationale: Using "Chart" in AddChartLabel was unnecessary since this function only relates to charts.

Shareable Link

http://tos.mx/Bl8hOn
 
Last edited:
A

anexx000

New member
so, copy your code to run it?

 
Last edited:

Top