NexusFi: Find Your Edge


Home Menu

 





VSA for ThinkorSwim


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one snowcloud with 93 posts (25 thanks)
    2. looks_two StockJock with 91 posts (27 thanks)
    3. looks_3 cbritton with 37 posts (71 thanks)
    4. looks_4 swimtrader with 22 posts (19 thanks)
      Best Posters
    1. looks_one Hornblower with 2.3 thanks per post
    2. looks_two cbritton with 1.9 thanks per post
    3. looks_3 StockJock with 0.3 thanks per post
    4. looks_4 snowcloud with 0.3 thanks per post
    1. trending_up 304,527 views
    2. thumb_up 223 thanks given
    3. group 86 followers
    1. forum 434 posts
    2. attach_file 131 attachments




 
Search this Thread

VSA for ThinkorSwim

  #431 (permalink)
skyfutures
Los Angeles, CA/USA
 
Posts: 2 since Dec 2018
Thanks Given: 0
Thanks Received: 0

Marcovth, would you be able to update your VSA study with the latest code adjustments?


marcovth View Post
I have implemented the EMA, Day/Night, and Hourly averages in the VSA7 script.

However, I have troubles sharing it. There are too many chars for this forum.
"The text that you have entered is too long (47247 characters). Please shorten it to 30000 characters long."

So, I will have to split it up.

VSA7 UPPER part 1

 
Code
declare upper;
declare real_size;


#######
# Arguments
input AvgVolumeType = {default EMA, Day_Night_Split, Hourly_Avg};
input volumeEMALength = 30;
input narrowSpreadFactor = 0.7;
input wideSpreadFactor = 1.5;
input aboveAvgVolfactor = 1.5;
input ultraHighVolfactor = 2;
input highCloseFactor = 0.70;
input lowCloseFactor = 0.25;
input GdojiFactor = 0.2; # C_RP
input WickFactor = 0.1; # C_RP
input shortTermLength = 5; #C_RP
input midTermLength = 15; #C_RP
input longTermLength = 40; #C_RP
input colorBars = {false, default true}; #C_RP
input trendText = {false, default true};
input volumeDefinitions = { false, default true };
input alerts = { default false, true };


def MarketsHours = if (secondsFromTime(0930) >= 0) and (secondsTillTime(1610) >= 0) then yes else no;

def Hour00 = if (secondsFromTime(0000) >= 0) and (secondsTillTime(0100) > 0) then yes else no;
def Hour01 = if (secondsFromTime(0100) >= 0) and (secondsTillTime(0200) > 0) then yes else no;
def Hour02 = if (secondsFromTime(0200) >= 0) and (secondsTillTime(0300) > 0) then yes else no;
def Hour03 = if (secondsFromTime(0300) >= 0) and (secondsTillTime(0400) > 0) then yes else no;
def Hour04 = if (secondsFromTime(0400) >= 0) and (secondsTillTime(0500) > 0) then yes else no;
def Hour05 = if (secondsFromTime(0500) >= 0) and (secondsTillTime(0600) > 0) then yes else no;
def Hour06 = if (secondsFromTime(0600) >= 0) and (secondsTillTime(0700) > 0) then yes else no;
def Hour07 = if (secondsFromTime(0700) >= 0) and (secondsTillTime(0800) > 0) then yes else no;
def Hour08 = if (secondsFromTime(0800) >= 0) and (secondsTillTime(0900) > 0) then yes else no;
def Hour09 = if (secondsFromTime(0900) >= 0) and (secondsTillTime(0930) > 0) then yes else no;
def Hour930 = if (secondsFromTime(0930) >= 0) and (secondsTillTime(1000) > 0) then yes else no;
def Hour10 = if (secondsFromTime(1000) >= 0) and (secondsTillTime(1100) > 0) then yes else no;
def Hour11 = if (secondsFromTime(1100) >= 0) and (secondsTillTime(1200) > 0) then yes else no;
def Hour12 = if (secondsFromTime(1200) >= 0) and (secondsTillTime(1300) > 0) then yes else no;
def Hour13 = if (secondsFromTime(1300) >= 0) and (secondsTillTime(1400) > 0) then yes else no;
def Hour14 = if (secondsFromTime(1400) >= 0) and (secondsTillTime(1500) > 0) then yes else no;
def Hour15 = if (secondsFromTime(1500) >= 0) and (secondsTillTime(1600) > 0) then yes else no;
def Hour16 = if (secondsFromTime(1600) >= 0) and (secondsTillTime(1630) > 0) then yes else no;
def Hour1630 = if (secondsFromTime(1630) >= 0) and (secondsTillTime(1700) > 0) then yes else no;
def Hour17 = if (secondsFromTime(1700) >= 0) and (secondsTillTime(1800) > 0) then yes else no;
def Hour18 = if (secondsFromTime(1800) >= 0) and (secondsTillTime(1900) > 0) then yes else no;
def Hour19 = if (secondsFromTime(1900) >= 0) and (secondsTillTime(2000) > 0) then yes else no;
def Hour20 = if (secondsFromTime(2000) >= 0) and (secondsTillTime(2100) > 0) then yes else no;
def Hour21 = if (secondsFromTime(2100) >= 0) and (secondsTillTime(2200) > 0) then yes else no;
def Hour22 = if (secondsFromTime(2200) >= 0) and (secondsTillTime(2300) > 0) then yes else no;
def Hour23 = if (secondsFromTime(2300) >= 0) and (secondsTillTime(2359) >= 0) then yes else no;


rec SumVol00 = if Hour00 then SumVol00[1] + volume else SumVol00[1];
rec nBarsHour00 = if Hour00 then nBarsHour00[1] + 1 else nBarsHour00[1];
def AvgVolHour00 = SumVol00 / nBarsHour00;

rec SumVol01 = if Hour01 then SumVol01[1] + volume else SumVol01[1];
rec nBarsHour01 = if Hour01 then nBarsHour01[1] + 1 else nBarsHour01[1];
def AvgVolHour01 = SumVol01 / nBarsHour01;

rec SumVol02 = if Hour02 then SumVol02[1] + volume else SumVol02[1];
rec nBarsHour02 = if Hour02 then nBarsHour02[1] + 1 else nBarsHour02[1];
def AvgVolHour02 = SumVol02 / nBarsHour02;

rec SumVol03 = if Hour03 then SumVol03[1] + volume else SumVol03[1];
rec nBarsHour03 = if Hour03 then nBarsHour03[1] + 1 else nBarsHour03[1];
def AvgVolHour03 = SumVol03 / nBarsHour03;

rec SumVol04 = if Hour04 then SumVol04[1] + volume else SumVol04[1];
rec nBarsHour04 = if Hour04 then nBarsHour04[1] + 1 else nBarsHour04[1];
def AvgVolHour04 = SumVol04 / nBarsHour04;

rec SumVol05 = if Hour05 then SumVol05[1] + volume else SumVol05[1];
rec nBarsHour05 = if Hour05 then nBarsHour05[1] + 1 else nBarsHour05[1];
def AvgVolHour05 = SumVol05 / nBarsHour05;

rec SumVol06 = if Hour06 then SumVol06[1] + volume else SumVol06[1];
rec nBarsHour06 = if Hour06 then nBarsHour06[1] + 1 else nBarsHour06[1];
def AvgVolHour06 = SumVol06 / nBarsHour06;

rec SumVol07 = if Hour07 then SumVol07[1] + volume else SumVol07[1];
rec nBarsHour07 = if Hour07 then nBarsHour07[1] + 1 else nBarsHour07[1];
def AvgVolHour07 = SumVol07 / nBarsHour07;

rec SumVol08 = if Hour08 then SumVol08[1] + volume else SumVol08[1];
rec nBarsHour08 = if Hour08 then nBarsHour08[1] + 1 else nBarsHour08[1];
def AvgVolHour08 = SumVol08 / nBarsHour08;

rec SumVol09 = if Hour09 then SumVol09[1] + volume else SumVol09[1];
rec nBarsHour09 = if Hour09 then nBarsHour09[1] + 1 else nBarsHour09[1];
def AvgVolHour09 = SumVol09 / nBarsHour09;

rec SumVol930 = if Hour930 then SumVol930[1] + volume else SumVol930[1];
rec nBarsHour930 = if Hour930 then nBarsHour930[1] + 1 else nBarsHour930[1];
def AvgVolHour930 = SumVol930 / nBarsHour930;

rec SumVol10 = if Hour10 then SumVol10[1] + volume else SumVol10[1];
rec nBarsHour10 = if Hour10 then nBarsHour10[1] + 1 else nBarsHour10[1];
def AvgVolHour10 = SumVol10 / nBarsHour10;

rec SumVol11 = if Hour11 then SumVol11[1] + volume else SumVol11[1];
rec nBarsHour11 = if Hour11 then nBarsHour11[1] + 1 else nBarsHour11[1];
def AvgVolHour11 = SumVol11 / nBarsHour11;

rec SumVol12 = if Hour12 then SumVol12[1] + volume else SumVol12[1];
rec nBarsHour12 = if Hour12 then nBarsHour12[1] + 1 else nBarsHour12[1];
def AvgVolHour12 = SumVol12 / nBarsHour12;

rec SumVol13 = if Hour13 then SumVol13[1] + volume else SumVol13[1];
rec nBarsHour13 = if Hour13 then nBarsHour13[1] + 1 else nBarsHour13[1];
def AvgVolHour13 = SumVol13 / nBarsHour13;

rec SumVol14 = if Hour14 then SumVol14[1] + volume else SumVol14[1];
rec nBarsHour14 = if Hour14 then nBarsHour14[1] + 1 else nBarsHour14[1];
def AvgVolHour14 = SumVol14 / nBarsHour14;

rec SumVol15 = if Hour15 then SumVol15[1] + volume else SumVol15[1];
rec nBarsHour15 = if Hour15 then nBarsHour15[1] + 1 else nBarsHour15[1];
def AvgVolHour15 = SumVol15 / nBarsHour15;

rec SumVol16 = if Hour16 then SumVol16[1] + volume else SumVol16[1];
rec nBarsHour16 = if Hour16 then nBarsHour16[1] + 1 else nBarsHour16[1];
def AvgVolHour16 = SumVol16 / nBarsHour16;

rec SumVol1630 = if Hour1630 then SumVol1630[1] + volume else SumVol1630[1];
rec nBarsHour1630 = if Hour1630 then nBarsHour1630[1] + 1 else nBarsHour1630[1];
def AvgVolHour1630 = SumVol1630 / nBarsHour1630;

rec SumVol17 = if Hour17 then SumVol17[1] + volume else SumVol17[1];
rec nBarsHour17 = if Hour17 then nBarsHour17[1] + 1 else nBarsHour17[1];
def AvgVolHour17 = SumVol17 / nBarsHour17;

rec SumVol18 = if Hour18 then SumVol18[1] + volume else SumVol18[1];
rec nBarsHour18 = if Hour18 then nBarsHour18[1] + 1 else nBarsHour18[1];
def AvgVolHour18 = SumVol18 / nBarsHour18;

rec SumVol19 = if Hour19 then SumVol19[1] + volume else SumVol19[1];
rec nBarsHour19 = if Hour19 then nBarsHour19[1] + 1 else nBarsHour19[1];
def AvgVolHour19 = SumVol19 / nBarsHour19;

rec SumVol20 = if Hour20 then SumVol20[1] + volume else SumVol20[1];
rec nBarsHour20 = if Hour20 then nBarsHour20[1] + 1 else nBarsHour20[1];
def AvgVolHour20 = SumVol20 / nBarsHour20;

rec SumVol21 = if Hour21 then SumVol21[1] + volume else SumVol21[1];
rec nBarsHour21 = if Hour21 then nBarsHour21[1] + 1 else nBarsHour21[1];
def AvgVolHour21 = SumVol21 / nBarsHour21;

rec SumVol22 = if Hour22 then SumVol22[1] + volume else SumVol22[1];
rec nBarsHour22 = if Hour22 then nBarsHour22[1] + 1 else nBarsHour22[1];
def AvgVolHour22 = SumVol22 / nBarsHour22;

rec SumVol23 = if Hour23 then SumVol23[1] + volume else SumVol23[1];
rec nBarsHour23 = if Hour23 then nBarsHour23[1] + 1 else nBarsHour23[1];
def AvgVolHour23 = SumVol23 / nBarsHour23;

rec SumVolMarketsHours = if MarketsHours then SumVolMarketsHours[1] + volume else SumVolMarketsHours[1];
rec nBarsMarketsHours = if MarketsHours then nBarsMarketsHours[1] + 1 else nBarsMarketsHours[1];
def AvgVolMarketsHours = SumVolMarketsHours / nBarsMarketsHours;

rec SumVolOFFMarketsHours = if !MarketsHours then SumVolOFFMarketsHours[1] + volume else SumVolOFFMarketsHours[1];
rec nBarsOFFMarketsHours = if !MarketsHours then nBarsOFFMarketsHours[1] + 1 else nBarsOFFMarketsHours[1];
def AvgVolOFFMarketsHours = SumVolOFFMarketsHours / nBarsOFFMarketsHours;

def AvgVolHourly=
if Hour00 then AvgVolHour00 else
if Hour01 then AvgVolHour01 else
if Hour02 then AvgVolHour02 else
if Hour03 then AvgVolHour03 else
if Hour04 then AvgVolHour04 else
if Hour05 then AvgVolHour05 else
if Hour06 then AvgVolHour06 else
if Hour07 then AvgVolHour07 else
if Hour08 then AvgVolHour08 else
if Hour09 then AvgVolHour09 else
if Hour930 then AvgVolHour930 else
if Hour10 then AvgVolHour10 else
if Hour11 then AvgVolHour11 else
if Hour12 then AvgVolHour12 else
if Hour13 then AvgVolHour13 else
if Hour14 then AvgVolHour14 else
if Hour15 then AvgVolHour15 else
if Hour16 then AvgVolHour16 else
if Hour1630 then AvgVolHour1630 else
if Hour17 then AvgVolHour17 else
if Hour18 then AvgVolHour18 else
if Hour19 then AvgVolHour19 else
if Hour20 then AvgVolHour20 else
if Hour21 then AvgVolHour21 else
if Hour22 then AvgVolHour22 else
if Hour23 then AvgVolHour23 else
 double.nan;

#plot AvgVolDailyMarketHrs = if MarketsHours then AvgVolMarketsHours else double.nan;
#plot AvgVolNightlyOFFMarketHrs = if !MarketsHours then AvgVolOFFMarketsHours else double.nan;

#plot AvgVolHourlyBars=AvgVolHourly;

# Calculate Volume moving average and it's standard deviation
rec sAvgVolume =  compoundValue(volumeEMALength, Average(volume, volumeEMALength), Double.NaN);
def sAvgVolumeSTD = stdev(sAvgVolume, volumeEMALength);

def AvgVol=
if AvgVolumeType==AvgVolumeType.Hourly_Avg then AvgVolHourly
else if AvgVolumeType==AvgVolumeType.EMA then sAvgVolume
else if MarketsHours then AvgVolMarketsHours else AvgVolOFFMarketsHours
;


def UHline =if AvgVolumeType==AvgVolumeType.EMA then sAvgVolume[0] + 2.0 * sAvgVolumeSTD else AvgVol + (AvgVol * 1);
def VHline =if AvgVolumeType==AvgVolumeType.EMA then sAvgVolume[0] + 1.0 * sAvgVolumeSTD else AvgVol + (AvgVol * 0.65);
def Hline =if AvgVolumeType==AvgVolumeType.EMA then sAvgVolume[0] else AvgVol + (AvgVol * 0.15);
def Lline =if AvgVolumeType==AvgVolumeType.EMA then sAvgVolume[0] - 1.0 * sAvgVolumeSTD else AvgVol - (AvgVol * 0.15);
def VLline =if AvgVolumeType==AvgVolumeType.EMA then sAvgVolume[0] - 2.0 * sAvgVolumeSTD else AvgVol - (AvgVol * 0.65);
def zeroline = 0;


#AddCloud(VHline, UHline, color.pink, color.pink);
#AddCloud(Hline, VHline, color.MAGENTA, color.MAGENTA);
#AddCloud(Lline, Hline, color.BLUE, color.BLUE);
#AddCloud(VLline, Lline, color.MAGENTA, color.MAGENTA);
#AddCloud(zeroline, VLline, color.pink, color.pink);


# 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.


#######
# Calculations

rec spread = high - low;
def median = (high + low ) / 2;
rec avgVolume = compoundValue(volumeEMALength, ExpAverage(volume, volumeEMALength), Double.NaN);

# Calculate Volume moving average and it's standard deviation
#rec sAvgVolume =  compoundValue(volumeEMALength, Average(volume, volumeEMALength), Double.NaN);
#def sAvgVolumeSTD = stdev(sAvgVolume, volumeEMALength);



# check if the vloume has been decreasing in the past two days.
def isTwoDaysLowVol = (volume < volume[1] && volume[0] < volume[2]);

# Calculate Range information
def avgSpread = WildersAverage(spread, volumeEMALength)[0];
rec isWideSpreadBar = (spread > (wideSpreadFactor * avgSpread));
rec isNarrowSpreadBar = (spread < (narrowSpreadFactor * avgSpread));

# Price information
rec isUpBar = close > close[1];
rec isDownBar = close < close[1];

# Check if the close is in the Highs/Lows/Middle of the bar.
# C_RP 20100809 
# original code - def x1 = if (close == low) then avgSpread else (spread / (close - low));
def x1 = if (high == low) then 2.0 else if (close == low) then 2.65 else (spread / (close - low));
# C_RP try the line below with various divisors totalSum result in a minimum of 2.3 on a spread of 1 pip instead of using a fixed 2.3 as in the line above
# def x1 = if (high==low) then 2.0 else if (close == low) then (spread / 0.43 ) else (spread / (close - low));



def isUpCloseBar = (x1 < 2);
def isDownCloseBar = (x1 > 2);
def isMidCloseBar = (x1 < 2.2 && x1 > 1.8);
def isVeryHighCloseBar = (x1 < 1.35);
# C_RP 20100809 added isVeryLowCloseBar
def isVeryLowCloseBar = (x1 >= 2.65);


# Trend Definitions
rec fiveDaysSma = compoundValue(5, Average(close, 5)[0], Double.NaN);
def LongTermTrendSlope = LinearRegressionSlope(price = fiveDaysSma, length = longTermLength)[0]; # 40
def MiddleTermTrendSlope = LinearRegressionSlope(price = fiveDaysSma, length = midTermLength)[0]; # 15
def ShortTermTrendSlope = LinearRegressionSlope(price = fiveDaysSma, length = shortTermLength)[0]; # 5

######################################################################
#  VSA Definitions
            
# utbar
rec isUpThrustBar = isWideSpreadBar && isDownCloseBar &&  ShortTermTrendSlope > 0 && middleTermTrendSlope > 0; #C_RP added positive middleTermTrendSlope requirement to filter out upThrusts in trends that are only short term. Consider adding longTermTrendSlope requirement as well.
# utcond1
def upThrustConditionOne = (isUpThrustBar[1] && isDownBar);
# utcond2
def upThrustConditionTwo = (isUpThrustBar[1] && isDownBar[0] && volume > volume[1]);
# utcond3
def upThrustConditionThree = (isUpThrustBar[0] && volume > 2 * AvgVol);
# scond1
rec isConfirmedUpThrustBar = (upThrustConditionOne OR upThrustConditionTwo OR upThrustConditionThree);
# scond
rec isNewConfirmedUpThrustBar = (isConfirmedUpThrustBar[0] && !isConfirmedUpThrustBar[1]);

# Two Period UpThrust Bar
rec isTwoPerUpT = isUpBar[1] && isWideSpreadBar[1] &&  isDownBar[0] && isDownCloseBar[0] && !isUpThrustBar[0] && (AbsValue(open[1] - close[0]) < (GdojiFactor * spread[1])) ;

# Three Period UpThrust Bar
rec isThreePerUpT = isUpBar[2] && isWideSpreadBar[2] &&  isDownBar[0] && isDownCloseBar[0] && !isUpThrustBar[0] && (AbsValue(open[2] - close[0]) < (GdojiFactor * spread[2])) ;


#  C_RP 20100816
# rec isGraveDojiBar = (spread > avgSpread) && (open == low) && (close == low); totally strict Gravestone Doji. Revised version below identifies a candle with above average spread, a real body smaller than 20% of the spread, and a lower wick less than 10% of the spread as a Gravestone Doji pictured as a white triangle above the candle.

rec isGraveDojiBar = (spread > avgSpread) && (AbsValue(open - close) < (GdojiFactor * spread)) &&  ((AbsValue(close - low) < (WickFactor * spread)) or (AbsValue(open - low) < (WickFactor * spread))); # less strict Gravestone Doji


#  trbar
def reversalLikelyBar = (volume[1] > AvgVol && isUpBar[1] && isWideSpreadBar[1] && isDownBar[0] && isDownCloseBar && isWideSpreadBar[0] && LongTermTrendSlope > 0 && high == Highest(high, 10)[0]);
            
# hutbar
rec isPseudoUpThrustBar = (isUpBar[1] && (volume[1] > aboveAvgVolfactor * AvgVol) && isDownBar[0] && isDownCloseBar && !isWideSpreadBar[0] && !isUpThrustBar[0]);
# hutcond
def pseudoUpThrustConfirmation = (isPseudoUpThrustBar[1] && isDownBar[0] && isDownCloseBar && !isUpThrustBar[0]);

# C_RP Failed UpThrustConfirmation or pseudoUpThrustConfirmation occurs when the close of bar following such confirmation is not lower than the close of the confirmation bar

rec isFailedUpThrustConfirmation = (isNewConfirmedUpThrustBar[1] or pseudoUpThrustConfirmation[1]) && close[0] >= close[1];

# tcbar
def weaknessBar = (isUpBar[1] && high[0] == Highest(high, 5)[0] && isDownBar[0] && (isDownCloseBar OR isMidCloseBar) && volume[0] > AvgVol && !isWideSpreadBar[0] && !isPseudoUpThrustBar[0]);

# stdn, stdn0, stdn1, stdn2
def strengthInDownTrend =  (volume[0] > volume[1] && isDownBar[1] && isUpBar[0] && (isUpCloseBar OR isMidCloseBar) && ShortTermTrendSlope < 0 && MiddleTermTrendSlope < 0);
def strengthInDownTrend0 = (volume[0] > volume[1] && isDownBar[1] && isUpBar[0] && (isUpCloseBar OR isMidCloseBar) && ShortTermTrendSlope < 0 && MiddleTermTrendSlope < 0 && LongTermTrendSlope < 0);
def strengthInDownTrend1 = (volume[0] > (AvgVol * aboveAvgVolfactor) && isDownBar[1] && isUpBar[0] && (isUpCloseBar OR isMidCloseBar) && ShortTermTrendSlope < 0 && MiddleTermTrendSlope < 0 && LongTermTrendSlope < 0);
def strengthInDownTrend2 = (volume[1] < AvgVol && isUpBar[0] && isVeryHighCloseBar && volume[0] > AvgVol && ShortTermTrendSlope < 0);


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #432 (permalink)
 Cabdoctor 
Sacramento CA/USA
 
Experience: Intermediate
Platform: TOS, Sierra Chart
Trading: Emini ES
Posts: 10 since Jul 2019
Thanks Given: 2
Thanks Received: 0

Anyone know if anyone has ported this over to the Sierra Charts platform?

Reply With Quote
  #433 (permalink)
 
WilleeMac's Avatar
 WilleeMac 
Prospect, KY. USA
 
Experience: None
Platform: Sierra Chart
Broker: Infinity
Trading: /CL
Posts: 687 since Jan 2012
Thanks Given: 309
Thanks Received: 617



Cabdoctor View Post
Anyone know if anyone has ported this over to the Sierra Charts platform?

I could be wrong but I think it has been done. Hit up the Sierra Chart thread .

-William

Follow me on Twitter Reply With Quote
  #434 (permalink)
 tradercy 
Detroit MI
 
Experience: Advanced
Platform: TOS, NinjaTrader
Trading: NQ, ES, CL
Posts: 2 since Mar 2019
Thanks Given: 0
Thanks Received: 1

I've downloaded the VPA code from the downloads but that was dated 2010. Is that the latest (or finale) code?
I've also followed this thread and it would seem there is updated code i.e VSA7? But that doesn't look complete?
Can anyone help me in getting the latest VPA code for TOS?
Thanks

Reply With Quote
  #435 (permalink)
steve252
new york ny ,united states
 
Posts: 1 since May 2023
Thanks Given: 0
Thanks Received: 0

this is my vsa lite conversion for tos lemme know wat u think ? I removed all principles except for upthrusts ,no demands ,tests ,and confirmed tests I wanted it as close to vsa lite as possible Attachment 332025

Attached Thumbnails
Click image for larger version

Name:	vsa lite 2.JPG
Views:	63
Size:	115.6 KB
ID:	332026  
Reply With Quote




Last Updated on May 21, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts