TOS average Volume Positive Negative (VPN) indicator
TOS released Markos Katsanos' new VPN indicator from the April issue of Stocks & Commodities. This indicator, as its name suggests, compares the difference between the volume on up days (positive) and the volume on down days (negative) with the total volume. You can read more about it here:https://mkatsanos.com/vpn-indicator/
Revised: Now uses @BigBoss's color scheme:
Study Shared Link: http://tos.mx/iIVibqk Click here for --> Easiest way to load shared links
Ruby:
# TOS TOS average Volume Positive Negative (VPN) indicator indicator
# w/ lipstick :) @MerryDay 7/21
declare lower;
input vpn_critical_value = 10 ;
DefineGlobalColor("Pre_Cyan", CreateColor(50, 200, 255)) ;
DefineGlobalColor("Canteloupe", CreateColor(255, 200, 150)) ;
plot VPN = reference VPNIndicator()."VPN" ;
plot VPN_avg = reference VPNIndicator()."VPNAvg" ;
def phase =
if VPN > VPN_avg and VPN > vpn_critical_value then 1 # leading
else if VPN < VPN_avg and VPN > vpn_critical_value then 2 # weakening
else if VPN < VPN_avg and VPN < vpn_critical_value then 3 # lagging
else if VPN < 0 then 5
else 4;
VPN.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
VPN.SetLineWeight(5);
VPN_avg.SetDefaultColor(Color.ORANGE);
VPN.AssignValueColor(
if phase == 1 then Color.GREEN
else if phase == 2 then Color.LIGHT_GRAY
else if phase == 3 then Color.RED
else if phase == 5 then color.yellow
else GlobalColor("Pre_Cyan"));
# ########################################################
AddLabel(yes,
if phase == 1 then "VPN: Leading"
else if phase == 2 then "VPN: Weakening"
else if phase == 3 then "VPN: Lagging"
else if phase == 5 then "VPN: Potential Zone"
else "VPN: Improving!",
if phase == 1 then Color.GREEN
else if phase == 2 then Color.LIGHT_GRAY
else if phase == 3 then Color.RED
else if phase == 5 then color.yellow
else GlobalColor("Pre_Cyan"));
Ruby:
# TOS TOS average Volume Positive Negative (VPN) indicator indicator
# w/ lipstick :) @MerryDay 7/21
declare lower;
input vpn_critical_value = 10 ;
DefineGlobalColor("Pre_Cyan", CreateColor(50, 200, 255)) ;
DefineGlobalColor("Canteloupe", CreateColor(255, 200, 150)) ;
def VPN = reference VPNIndicator()."VPN" ;
def VPN_avg = reference VPNIndicator()."VPNAvg" ;
def phase =
if VPN > VPN_avg and VPN > vpn_critical_value then 1 # leading
else if VPN < VPN_avg and VPN > vpn_critical_value then 2 # weakening
else if VPN < VPN_avg and VPN < vpn_critical_value then 3 # lagging
else if VPN < 0 then 5
else 4;
# ########################################################
AddLabel(yes,
if phase == 1 then "Leading"
else if phase == 2 then "Weakening"
else if phase == 3 then "Lagging"
else if phase == 5 then "Potential"
else "Improving!");
AssignBackgroundColor(
if phase == 1 then Color.GREEN
else if phase == 2 then Color.LIGHT_GRAY
else if phase == 3 then Color.RED
else if phase == 5 then color.yellow
else color.cyan);
Last edited: