Vervoort Crossover Indicator with Watchlist for ThinkorSwim

dougn

dougn

New member
VIP
Study here...

Code:
# VervoortCrossover

# (c) 2009 http://www.thinkscripter.com

# [email protected]

# Last Update 30 MAR 2009

# Tweaked by R Houseer August 2012

# RH_Vervoort_Channel_V2

# Buy scan - RH_Vervoort_Channel_V2().signalBuy #buy scan

# Sell scan - RH_Vervoort_Channel_V2().signalSell # sell scan

# Scan both - RH_Vervoort_Channel_V2().signalBuy or RH_Vervoort_Channel_V2().signalSell #scan for either

# Alerts added - option added to be turned on and off

input period = 55;

input alertsOn = yes;

def price = (high+low+close)/3;

#-----Typical Price ZeroLag Triple Exponential Moving Average

def TMA1 = 3 * ExpAverage(price, period)

- 3 * ExpAverage(ExpAverage(price, period), period)

+ ExpAverage(ExpAverage(ExpAverage(price, period)

, period), period);

def TMA2 = 3 * ExpAverage(TMA1, period)

- 3 * ExpAverage(ExpAverage(TMA1, period), period)

+ ExpAverage(ExpAverage(ExpAverage(TMA1, period)

, period), period);

def difference = TMA1 - TMA2;

plot TypicalPriceZeroLagTEMA = TMA1 + difference;

TypicalPriceZeroLagTEMA.SetDefaultColor(color.green);

#------Heikin-Ashi Close ZeroLag Triple Exponential Moving Average

rec haopen = compoundValue(1, ((open[1] + high[1]

+ low[1] + close[1]) / 4 + haopen[1]) / 2, hl2);

def haclose = ((open + high + low + close) / 4 + haopen

+ Max(high, haopen) + Min(low, haopen)) / 4;

def HATMA1 = 3 * ExpAverage(haclose, period)

- 3 * ExpAverage(ExpAverage(haclose, period), period)

+ ExpAverage(ExpAverage(ExpAverage(haclose, period)

, period), period);

def HATMA2 = 3 * ExpAverage(HATMA1, period)

- 3 * ExpAverage(ExpAverage(HATMA1, period), period)

+ ExpAverage(ExpAverage(ExpAverage(HATMA1, period)

, period), period);

def HAdifference = HATMA1 - HATMA2;

plot HeikinAshiZeroLagTEMA = HATMA1 + HAdifference;

HeikinAshiZeroLagTEMA.SetDefaultColor(color.plum);

def buySignal = if TypicalPriceZeroLagTEMA > HeikinAshiZeroLagTEMA and TypicalPriceZeroLagTEMA[1] <= HeikinAshiZeroLagTEMA[1] then 1 else 0;

def sellSignal = if TypicalPriceZeroLagTEMA < HeikinAshiZeroLagTEMA and TypicalPriceZeroLagTEMA[1] >= HeikinAshiZeroLagTEMA[1] then 1 else 0;

plot signalBuy = if buySignal then TypicalPriceZeroLagTEMA * 0.999 else double.nan;

signalBuy.SetDefaultColor( Color.UPTICK );

signalBuy.SetLineWeight(3);

signalBuy.SetPaintingStrategy( PaintingStrategy.ARROW_UP );

plot signalSell = if sellSignal then TypicalPriceZeroLagTEMA * 1.0015 else double.nan;

signalSell.SetDefaultColor( Color.DOWNTICK );

signalSell.SetLineWeight(3);

signalSell.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
 
Last edited by a moderator:
dougn

dougn

New member
VIP
Vervoort watchlist column...

Code:
# VervoortCrossover

# (c) 2009 http://www.thinkscripter.com

# [email protected]

# Last Update 30 MAR 2009

# Tweaked by R Houseer August 2012

# RH_Vervoort_Channel_V2

# Buy scan - RH_Vervoort_Channel_V2().signalBuy #buy scan

# Sell scan - RH_Vervoort_Channel_V2().signalSell # sell scan

# Scan both - RH_Vervoort_Channel_V2().signalBuy or RH_Vervoort_Channel_V2().signalSell #scan for either

# Alerts added - option added to be turned on and off



input period = 55;

input alertsOn = yes;



def price = (high+low+close)/3;



#-----Typical Price ZeroLag Triple Exponential Moving Average



def TMA1 = 3 * ExpAverage(price, period)

- 3 * ExpAverage(ExpAverage(price, period), period)

+ ExpAverage(ExpAverage(ExpAverage(price, period)

, period), period);



def TMA2 = 3 * ExpAverage(TMA1, period)

- 3 * ExpAverage(ExpAverage(TMA1, period), period)

+ ExpAverage(ExpAverage(ExpAverage(TMA1, period)

, period), period);



def difference = TMA1 - TMA2;

def TypicalPriceZeroLagTEMA = TMA1 + difference;



#------Heikin-Ashi Close ZeroLag Triple Exponential Moving Average



rec haopen = compoundValue(1, ((open[1] + high[1]

+ low[1] + close[1]) / 4 + haopen[1]) / 2, hl2);

def haclose = ((open + high + low + close) / 4 + haopen

+ Max(high, haopen) + Min(low, haopen)) / 4;



def HATMA1 = 3 * ExpAverage(haclose, period)

- 3 * ExpAverage(ExpAverage(haclose, period), period)

+ ExpAverage(ExpAverage(ExpAverage(haclose, period)

, period), period);



def HATMA2 = 3 * ExpAverage(HATMA1, period)

- 3 * ExpAverage(ExpAverage(HATMA1, period), period)

+ ExpAverage(ExpAverage(ExpAverage(HATMA1, period)

, period), period);



def HAdifference = HATMA1 - HATMA2;



def HeikinAshiZeroLagTEMA = HATMA1 + HAdifference;



def buySignal = if TypicalPriceZeroLagTEMA > HeikinAshiZeroLagTEMA and TypicalPriceZeroLagTEMA[1] <= HeikinAshiZeroLagTEMA[1] then 1 else 0;



def sellSignal = if TypicalPriceZeroLagTEMA < HeikinAshiZeroLagTEMA and TypicalPriceZeroLagTEMA[1] >= HeikinAshiZeroLagTEMA[1] then 1 else 0;



def signalBuy = if buySignal then TypicalPriceZeroLagTEMA * 0.999 else double.nan;



def signalSell = if sellSignal then TypicalPriceZeroLagTEMA * 1.0015 else double.nan;



# coding addition by @DTWCoachandDude on Twitter

# http://www.stocktwits.com/DTWCoachandDude/ …

# http://www.facebook.com/DTWCoachandDude/ …

# https://www.twitter.com/DTWCoachandDude/ …



plot SignalPlot =

if buySignal

then TypicalPriceZeroLagTEMA * 0.999

else if sellSignal

then TypicalPriceZeroLagTEMA * 1.0015

else double.nan;

SignalPlot.assignvalueColor(

if buySignal

then color. black

else if sellSignal

then color. black

else color. black);



assignbackgroundColor(

if buySignal

then color. green

else if sellSignal

then color. red

else color. black);
 
Last edited by a moderator:

Top