TradingView
gurple
Oct 16, 2014 3:47 PM

Lazy Long Term Signals 

SPDR S&P 500 ETF TRUSTArca

Description

This little indicator displays the ratio between the series close and the (default 45) exponential moving average.

The idea is to consider buying when the signal is above 1 and sell, or short if aggressive, when the signal crosses below 1. It strikes me as useful when used in conjunction with the MACD and UCSgears' Linear Regression Slope indicator.

Using such a simple strategy as I outlined above is probably only useful (if it even works) and beneficial in long term or tax deferred accounts like 401Ks, IRAs, ROTH IRAs, etc. Otherwise the taxation would probably destroy the appreciation. Who wants that?

Release Notes

I've altered the default EMA time frame to 90 and also put two of these oscillators within the script (the second EMA defaulting to 180). This allows to see a fast and slow version simultaneously. I like to use it showing the EMA of the 'fast' LLTS with the signal of the 'slow'.
Comments
CodyMaki
this is amazing just came across it very cool totally will be backtesting this out cheers from canada
gurple
@CodyMaki, hope it might find some utility for you. Let me know if you find something interesting. I've never played or built any backtesting strategies in TV with Pine.
Cheers!
DSM2
Nice work!
gurple
Considering the light interest in this little oscillator of mine I thought good that I provide the updated version of this script as it has changed lightly in the intervening years. All that's really changed is that I've abandoned the 45 EMA in favor of a 90 EMA.
==========START Script ==========
// Buy when the signal croses above 1 (signal goes green).
// Sell, or short if aggressive, when the signal crosses below 1 (signal goes red).
// NOTE: Taking this stategy is probably only beneficial in Long Term accounts (401k, ROTH IRA, etc.).
// NOTE: Otherwise the capital gains taxing could destroy any appreciation.

study(title="Lazy Long Term Signals", shorttitle="LzyLngTrmSig", overlay=false)
lltssrc = close
shrt_ema_len=input(90, minval=1, defval=90, title="Short EMA Length")
lng_ema_len=input(90, minval=1, defval=90, title="Long EMA Length")

shrt_ema = ema(lltssrc, shrt_ema_len)
rltv_strngth_data = lltssrc/shrt_ema

ema_of_rltv_strngth_data = ema(rltv_strngth_data, lng_ema_len)

buy = rltv_strngth_data > 1
sell = rltv_strngth_data < 1
lltscolor = buy ? green : sell ? red : blue

//plot(shrt_ema, color= green)
//plot(rltv_strngth_data, color= red)

plot(1, color = orange, transp=85)
plot(rltv_strngth_data, color = lltscolor, title ="LLTS", style = line, linewidth = 1, trackprice = true)
plot(ema_of_rltv_strngth_data, color = fuchsia, title ="EMA of LLTS", style = line, linewidth = 1, trackprice = false)
========== END Script ==========
heglassedme
Another nice tool arrived in my park of useful oscillators. I liked this one.
More