StockFetcher Forums · Filter Exchange · Vervoort Crossover help<< 1 2 >>Post Follow-up
athrasher
11 posts
msg #96406
Ignore athrasher
9/20/2010 11:23:11 AM

I came across this moving average crossover at thinkscript (http://www.thinkscripter.com/indicator/vervoort-crossover/) that I then back tested on Thinkorswim and it appeared to to work fairly well. I wanted to be able to run a filter on it and back test it a little more extensively.

I do not know how to code something this 'advanced' (advanced for me at least) and the other posts on the topic were inconclusive.

from Thinkscript:
Specifically, Vervoort used a zero-lag triple exponential moving average of 1) the typical price (h+l+c)/3 and 2) the Heikin-Ashi close. and a 55 period average on daily charts was optimal.

More info can be found in the script in the link I provided above.

I'd appreciate anyone's help with this.

tennek1719
7 posts
msg #96450
Ignore tennek1719
9/22/2010 3:34:12 PM

The following was an attempt to code the Vervoort Crossover in SF. Kept hitting the following barrier "Warning: filter expression exceeds limit" once got to a certain point. I have not worked on this in a while all suggestions are welcomed

symlist(SPY)

/*##### input period = 55;

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

Set{P1, high + low}
Set{P2, P1 + close}
Set{P3, P2 / 3}

/*#-----Typical Price Triple Exponential Moving Average #####*/
/* #####. def TMA1 = 3 * ExpAverage(price, period)- 3 * ExpAverage(ExpAverage(price, period), period)+ ExpAverage(ExpAverage(ExpAverage(price, period), period), period) #####*/

Set{EMA1, cEMA(p3, 55)}
Set{EMA2, CEMA(EMA1, 55)}
Set{EMA3, CEMA(EMA2, 55)}

Set{TMA1, EMA1 - EMA2}
Set{TMA2, TMA1 * 3}
Set{TMA4, TMA2 + EMA3}

/* ###### def TMA2 = 3 * ExpAverage(TMA1, period)- 3 * ExpAverage(ExpAverage(TMA1, period), period)+ ExpAverage(ExpAverage(ExpAverage(TMA1, period), period), period) #####*/


Set{EMA5, CEMA(TMA4, 55)}
Set{EMA6, CEMA(EMA5, 55)}
Set{EMA7, CEMA(EMA6, 55)}

Set{TMA5, EMA5 - EMA6}
Set{TMA6, TMA5 * 3}
Set{TMA8, TMA6 + EMA7}

/*## def difference = TMA1 - TMA2 ##*/

Set{Dif1, TMA4 - TMA8}
Set{TEMA, TMA4 + Dif1}
draw tema on plot price

/* #------Heikin-Ashi Close Triple Exponential Moving Average
xClose = (Open+High+Low+Close)/4
o Average price of the current bar

xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
o Midpoint of the previous bar

xHigh = Max(High, xOpen, xClose)
o Highest value in the set */


/*DEFINE haopen = compoundValue(1, ((open[1] + high[1] + low[1] + close[1]) / 4 + haopen[1]) / 2, hl2); xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
o Midpoint of the previous bar */

Set{Hao1, close 1-day ago + open 1-day ago}
Set{Hao2, high 1-day ago + low 1-day ago}
Set{Hao3, Hao1 + Hao2}
Set{HAO5, Hao3 / 4}
Set{Hao6, open 1-day ago + close 1-day ago}
Set{Hao7, Hao6 / 2}
Set{HAO, HAO5 + Hao7}

/* def haclose = ((open + high + low + close) / 4 + haopen + Max(high, haopen) + Min(low, haopen)) / 4; xClose = (Open+High+Low+Close)/4
o Average price of the current bar */

Set{HAC1, open + close}
Set{HAC2, high + Low}
Set{HAC3, HAC1 + HAC2}
Set{HAC4, HAC3 / 4}
Set{HAC5, HAC1 + high}
Set{HAC6, HAC5 + open}
Set{HAC7, HAC4 + HAC6}
Set{HAC, HAC7 / 4}

/* def HATMA1 = 3 * ExpAverage(haclose, period)- 3 * ExpAverage(ExpAverage(haclose, period), period)+ ExpAverage(ExpAverage(ExpAverage(haclose, period), period), period); */
Set{Hat1, CEMA(HAC, 55)}
Set{Hat2, CEMA(Hat1, 55)}
Set{Hat3, CEMA(Hat2, 55)}
Set{Hat4, Hat1 - Hat2}
Set{Hat5, Hat4 * 3}
Set{HAT, Hat5 + Hat3}

/* def HATMA2 = 3 * ExpAverage(HATMA1, period)- 3 * ExpAverage(ExpAverage(HATMA1, period), period)+ ExpAverage(ExpAverage(ExpAverage(HATMA1, period), period), period); */
Set{Haa1, CEMA(Hat, 55)}
Set{Haa2, CEMA(Haa1, 55)}
Set{Haa3, CEMA(Haa2, 55)}
Set{Haa4, Haa1 - Haa2}
Set{Haa5, Haa4 * 3}
Set{Haa, Haa5 + Haa3}
/* def HAdifference = HATMA1 - HATMA2; */
Set{HaDf, HAT - HAA}
/*plot HeikinAshiZeroLagTEMA = HATMA1 + HAdifference;*/
Set{Dema, HAT + HaDf}
Draw Dema on plot price
add column DEMA {DEMA}
add column TEMA {TEMA}


olathegolf
119 posts
msg #96482
Ignore olathegolf
9/23/2010 1:50:13 PM

It takes a while but I can get it to run.

athrasher
11 posts
msg #96483
Ignore athrasher
9/23/2010 2:32:59 PM

yeah I got the same warning when I tried to run it. (I just have a standard account)

olathegolf - what did you change to get it to run?

tennek1719
7 posts
msg #96484
Ignore tennek1719
9/23/2010 2:37:34 PM

Defining the Heikin-Ashi open and closed seems to clause problems and exceeds the expression limits set in SF. I replaced those values with the "close one day ago" and the results were similiar to the orginal crossover.



symlist(SPY)

/*##### input period = 55;

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

Set{P1, high + low}
Set{P2, P1 + close}
Set{P3, P2 / 3}

/*#-----Typical Price Triple Exponential Moving Average #####*/
/* #####. def TMA1 = 3 * ExpAverage(price, period)- 3 * ExpAverage(ExpAverage(price, period), period)+ ExpAverage(ExpAverage(ExpAverage(price, period), period), period) #####*/

Set{EMA1, cEMA(p3, 55)}
Set{EMA2, CEMA(EMA1, 55)}
Set{EMA3, CEMA(EMA2, 55)}

Set{TMA1, EMA1 - EMA2}
Set{TMA2, TMA1 * 3}
Set{TMA4, TMA2 + EMA3}

/* ###### def TMA2 = 3 * ExpAverage(TMA1, period)- 3 * ExpAverage(ExpAverage(TMA1, period), period)+ ExpAverage(ExpAverage(ExpAverage(TMA1, period), period), period) #####*/


Set{EMA5, CEMA(TMA4, 55)}
Set{EMA6, CEMA(EMA5, 55)}
Set{EMA7, CEMA(EMA6, 55)}

Set{TMA5, EMA5 - EMA6}
Set{TMA6, TMA5 * 3}
Set{TMA8, TMA6 + EMA7}

/*## def difference = TMA1 - TMA2 ##*/

Set{Dif1, TMA4 - TMA8}
Set{TEMA, TMA4 + Dif1}
draw tema on plot price


/* #------Heikin-Ashi Close Triple Exponential Moving Average
xClose = (Open+High+Low+Close)/4
o Average price of the current bar

xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
o Midpoint of the previous bar

xHigh = Max(High, xOpen, xClose)
o Highest value in the set */


/*DEFINE haopen = compoundValue(1, ((open[1] + high[1] + low[1] + close[1]) / 4 + haopen[1]) / 2, hl2); xOpen = [xOpen(Previous Bar) + Close(Previous Bar)]/2
o Midpoint of the previous bar */

/*Set{Hao1, close 1-day ago + open 1-day ago}
Set{Hao2, high 1-day ago + low 1-day ago}
Set{Hao3, Hao1 + Hao2}
Set{HAO5, Hao3 / 4}
Set{Hao6, open 1-day ago + close 1-day ago}
Set{Hao7, Hao6 / 2}
Set{HAO, HAO5 + Hao7} */

/* def haclose = ((open + high + low + close) / 4 + haopen + Max(high, haopen) + Min(low, haopen)) / 4; xClose = (Open+High+Low+Close)/4
o Average price of the current bar */

/*Set{HAC1, open + close}
Set{HAC2, high + Low}
Set{HAC3, HAC1 + HAC2}
Set{HAC4, HAC3 / 4}
Set{HAC5, HAO + high 1-day ago}
Set{HAC6, HAC5 + open 1-day ago}
Set{HAC7, HAC5 + HAC4}
Set{HAC, HAC7 / 4} */
Set{HAC, Close 1-day ago}

/* def HATMA1 = 3 * ExpAverage(haclose, period)- 3 * ExpAverage(ExpAverage(haclose, period), period)+ ExpAverage(ExpAverage(ExpAverage(haclose, period), period), period); */
Set{Hat1, CEMA(HAC, 55)}
Set{Hat2, CEMA(Hat1, 55)}
Set{Hat3, CEMA(Hat2, 55)}
Set{Hat4, Hat1 - Hat2}
Set{Hat5, Hat4 * 3}
Set{Hat, Hat5 + Hat3}


/* def HATMA2 = 3 * ExpAverage(HATMA1, period)- 3 * ExpAverage(ExpAverage(HATMA1, period), period)+ ExpAverage(ExpAverage(ExpAverage(HATMA1, period), period), period); */
Set{Haa1, CEMA(Hat, 55)}
Set{Haa2, CEMA(Haa1, 55)}
Set{Haa3, CEMA(Haa2, 55)}
Set{Haa4, Haa1 - Haa2}
Set{Haa5, Haa4 * 3}
Set{Haa, Haa5 + Haa3}
/* def HAdifference = HATMA1 - HATMA2; */
Set{HaDf, HAT - HAA}
/*plot HeikinAshiZeroLagTEMA = HATMA1 + HAdifference;*/
Set{Dema, HAT + HaDf}
Draw Dema on plot price
add column DEMA {DEMA}
add column TEMA {TEMA}


duke56468
683 posts
msg #96485
Ignore duke56468
9/23/2010 3:02:12 PM

Is there any way to code this Vervoort ATR trailing stop into StockFetcher? It seems very useful. Sorry if I'm off subject, but it is still about Vervoort.

http://www.traders.com/Documentation/FEEDbk_Docs/2009/06/Vervoort.html

tennek1719
7 posts
msg #96486
Ignore tennek1719
9/23/2010 3:42:19 PM

Not sure if this indicator is very useful in a SF filter other than to show general direction of a stock or an index, trend is up when TEMA > DEMA. If you add any more computations or comparisons you exceed the SF expression limit.

duke56468
683 posts
msg #96488
Ignore duke56468
9/23/2010 4:07:12 PM

tennek1719
msg #96486
- Ignore tennek1719 9/23/2010 3:42:19 PM

Not sure if this indicator is very useful in a SF filter other than to show general direction of a stock or an index, trend is up when TEMA > DEMA. If you add any more computations or comparisons you exceed the SF expression limit.
-----------------------------------------------------------------------------------------------------------------------------------------------------------

tennek.....I was just hoping someone could code a filter for this Vervoort ATR to draw on the plot price and use it to check against my watch list. I have tried in the past but too incompetent at coding.


tennek1719
7 posts
msg #96493
Ignore tennek1719
modified
9/23/2010 8:04:11 PM

try this for longs :



symlist(spy)
/* Notes from http://www.traders.com/Documentation/FEEDbk_Docs/2009/06/Vervoort.html
The Atr indicator measures a securityˇ¦s volatility. Wilder defined the true range concept as the greatest value of the:
„X Current high less the current low
„X Absolute value of the current high less the previous close
„X Absolute value of the current low less the previous close.

With this formula you could create an Atr value based on something other than the close, such as an average price. I use the daily Low one day ago.

It appears that the correct entry maybe a close above the highest of the 3 EMA values with the exit a close below.

The following is form the link ˇĄTo create a trailing stop based on the Atr value, you need to calculate the maximum-allowed loss based on the Atr value multiplied by a factor. In Figure 1 you can see the 14% fixed trailing-stop value plotted in red on the chart of Amd. The blue line is the Atr trailing stop based on a five-day Atr average multiplied by a factor of 3.5. Note the Atr trailing buy & sell points on the chart. You would buy (green arrow) when the closing price moves above the trailing stop of the previous day and sell when the closing price falls below the previous trailing-stop value (red Exit sign).ˇ¦ */

/* set price to calulate ATR, open, low, high, close*/

Set{PPoint, low 1-day ago}

Set{CATR1a, High - Low}
Set{CATR1b, ppoint - CATR1a}
Set{CATR2a, High - close 1-day ago}
Set{CATR2b, ABS(CATR2a)}
Set{CATR2c, ppoint - CATR2b}
Set{CATR3a, Low - close 1-day ago}
Set{CATR3b, ABS(CATR3a)}
Set{CATR3c, ppoint - CATR3b}
Set{CATR1, CEMA(CATR1b, 5)}
Set{CATR2, CEMA(CATR2c, 5)}
Set{CATR3, CEMA(CATR3c, 5)}
Draw CATR1 on plot price
Draw CATR2 on plot price
Draw CATR3 on plot price


olathegolf
119 posts
msg #96494
Ignore olathegolf
9/23/2010 9:50:27 PM

athrasher - I did not change the filter. I assume that I was able to run it because I have the premium membership.


StockFetcher Forums · Filter Exchange · Vervoort Crossover help<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.