input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.Week;
def o = open(period = agg);
def c = close(period = agg);
def data = fold i = 0 to length
with s
do s + (if c > getValue(o, i)
then 1
else if c < getValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then color.green
else color.Red);
Signal.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.HideBubble();
Signal.HideTitle();
plot OB = 10.5;
Plot ArrowDn = signal crosses below OB;
#Plot ArrowDn = Main crosses below Signal;
@markos Thanks for that reminder!! Relative Strength !! There are few sharing of relative strength indicator here, if you are using any of them, may i request you to share again...thanksYes, @Nick now that's better. Potential Reversal is the key. Is the market or other stocks in its group week or strong? But, that's the idea.
#IBD RS Label by markos 9-26-19
#Best used on 1Yr/1Day Agg
Declare Lower;
#declare real_size;
def Data = close / close("SPX");
def RS = Data;
input length = 252;
def RSLow = Lowest(RS, length);
def RSHigh = Highest(RS, length);
def RSRank = Round(100 * (RS - RSLow) / (RSHigh - RSLow), 0);
Addlabel(yes,"MYRS " + RSRANK,Color.DARK_GREEN);
#IBD RS Line by markos 4-26-19
#Best used on 1Yr/1Day Agg
Declare Lower;
def Data = close / close("SPX");
def RS = data;
input length = 1; #Length of Hull for line smoothing
input displace = 0;
plot HMA = MovingAverage(AverageType.HULL, RS, length);
#IBD RS Watchlist Code by markos 9-26-19
#Best used on 1Yr/1Day Agg
Declare Lower;
def Data = close / close("SPX");
def RS = Data;
input length = 252;
def RSLow = Lowest(RS, length);
def RSHigh = Highest(RS, length);
def RSRank = Round(99 * (RS - RSLow) / (RSHigh - RSLow), 0);
Addlabel(yes,RSRANK,Color.YELLOW);
#This is exact to IBD
# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation
# Mobius
# V01.05.2018
#hint: TMO calculates momentum using the DELTA of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.FIFTEEN_MIN;
def o = open(period = agg);
def c = close(period = agg);
def data = fold i = 0 to length
with s
do s + (if c > GetValue(o, i)
then 1
else if c < GetValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.HideBubble();
Signal.HideTitle();
AddCloud(Main, Signal, Color.GREEN, Color.RED);
plot zero = if IsNaN(c) then Double.NaN else 0;
zero.SetDefaultColor(Color.GRAY);
zero.HideBubble();
zero.HideTitle();
plot ob = if IsNaN(c) then Double.NaN else Round(length * .7);
ob.SetDefaultColor(Color.GRAY);
ob.HideBubble();
ob.HideTitle();
plot os = if IsNaN(c) then Double.NaN else -Round(length * .7);
os.SetDefaultColor(Color.GRAY);
os.HideBubble();
os.HideTitle();
AddCloud(ob, length, Color.LIGHT_RED, Color.LIGHT_RED, no);
AddCloud(-length, os, Color.LIGHT_GREEN, Color.LIGHT_GREEN);
# End Code TMO with Higher Aggregation
# Backtesting Code
def buy = Main crosses above Signal;
def sell = Main crosses below Signal;
AddOrder(OrderType.BUY_AUTO, condition = buy, price = close, 100, tickcolor = Color.GREEN, arrowcolor = Color.GREEN);
AddOrder(OrderType.SELL_AUTO, condition = sell, price = close, 100, tickcolor = Color.RED, arrowcolor = Color.RED);
Ive been looking all over for this indicator. Thank you for adding the arrows! To avoid false signals, any chance we can make the arrows appear when the Main crosses the Signal in OB or OS territory only? That would be amazing if that was possible.Turned this into an upper indicator with breakout arrows and it's amazing for reversals. You'll get alot of fakeouts in choppy markets, so look for confirmations elsewhere. Quickest reversal alert I've found.
Code:# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation breakouts only # Mobius # custom by WTF_Dude based off V01.05.2018 #hint: TMO calculates momentum using the DELTA of price. Giving a much better picture of trend, trend reversals and divergence than momentum oscillators using price. declare upper; input length = 21; input calcLength = 5; input smoothLength = 3; input agg = AggregationPeriod.DAY; def o = open(period = agg); def c = close(period = agg); def data = fold i = 0 to length with s do s + (if c > getValue(o, i) then 1 else if c < getValue(o, i) then - 1 else 0); def EMA5 = ExpAverage(data, calcLength); def Main = ExpAverage(EMA5, smoothLength); def Signal = ExpAverage(Main, smoothLength); #Main.AssignValueColor(if Main > Signal # then color.green # else color.red); # Signal.AssignValueColor(if Main > Signal # then color.green # else color.red); # Signal.HideBubble(); #Signal.HideTitle(); #addCloud(Main, Signal, color.green, color.red); plot Bull = Crosses(main, signal, CrossingDirection.ABOVE); plot Bear = Crosses(main, signal, CrossingDirection.BELOW); Bull.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); Bull.SetDefaultColor(Color.CYAN); Bull.SetLineWeight(2); Bear.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); Bear.SetDefaultColor(Color.MAGENTA); Bear.SetLineWeight(2);
#TMO True Momentum Oscillator with Higher Aggregation _Mobius
#Tuesday, May 15, 2018 12:36 PM
## OneNote Archive Name: TMO True Momentum Oscillator with Higher Aggregation _Mobius
## Archive Section: Momentum
## Suggested Tos Name: TrueMomentumOscillator_w_HigherAggregation_Mobius
## Archive Date: 5.15.2018
## Archive Notes:
## 08:43 Mobius: Well give it a few days to get altered, muched, distorted and twisted. Then when it get back to being used as intended someone will start making money with it.
## 08:45 Mobius: Oh and in my view - It's highest and best use is as designed with a secondary aggregation plotted either on it or with it around 5 to 10 time higher.
## "##" indicates an addition or adjustment by the OneNote Archivist
## Original Code Follows
# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation
# Mobius
# V01.05.2018
#hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.
declare Lower;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.weeK;
def o = open(period = agg);
def c = close(period = agg);
def data = fold i = 0 to length
with s
do s + (if c > getValue(o, i)
then 1
else if c < getValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then color.green
else color.Red);
Signal.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, Color.LIGHT_GREEN, color.red);
plot zero = if isNaN(c) then double.nan else 0;
zero.SetDefaultColor(Color.gray);
zero.hideBubble();
zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .8);
ob.SetDefaultColor(Color.gray);
ob.HideBubble();
ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .8);
os.SetDefaultColor(Color.gray);
os.HideBubble();
os.HideTitle();
addCloud(ob, length, Color.GREEN, Color.GREEN, Yes);
addCloud(-length, os, Color.LIGHT_RED, Color.LIGHT_RED, showBorder = Yes);
def A = Main > Signal and main > zero;
def B = signal > Main and signal < zero ;
def X = main > OB;
def Z = signal < OS ;
def XX = signal > OB;
def ZZ = main < OS ;
def Y = A==0 and B==0 and X==0 and Z==0 and XX==0 and ZZ==0;
assignpriceColor(if A then color.dark_GREEN else color.CURRENT);
assignpriceColor(if B then color.RED else color.current);
assignpriceColor(if X then color.green else color.current);
assignpriceColor(if Z then color.pink else color.current);
assignpriceColor(if XX then color.green else color.current);
assignpriceColor(if ZZ then color.pink else color.current);
assignpriceColor(if Y then color.plum else color.current);
# End Code TMO with Higher Aggregation
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Archived: TMO True Momentum Oscillator | Indicators | 346 | ||
TMO True Momentum Oscillator For ThinkOrSwim | Indicators | 128 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.