Mobius states:
The TMO calculates momentum using the delta of price.
Price delta gauges the change rate, providing a dynamic view of direction and intensity. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.
Secondary aggregation to help determine overall trend.
Signal lines (vertical green lines) are plotted for LONG trades only.
Squeeze indicator was added to show areas of price compression.
per member request: @Phatrook
The TMO calculates momentum using the delta of price.
Price delta gauges the change rate, providing a dynamic view of direction and intensity. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.
Secondary aggregation to help determine overall trend.
Trades when secondary aggregation is at extremes and primary aggregation signals a trade at extremes have a higher probability of extended gains.
A 10 times +- difference in aggregation between the chart aggregation and the secondary aggregation gives adequate higher aggregation view of trend.
Signal lines (vertical green lines) are plotted for LONG trades only.
Squeeze indicator was added to show areas of price compression.
If squeeze is indicated and secondary aggregation stays in trend, look for price to continue after exiting squeeze in the same trend as prior to squeeze.
If primary is rolling over or already at extremes, the probability is much greater that there will be a polarity change once price exits the squeeze.
Ruby:
# TMO ((T)rue (M)omentum (O)scillator) Trend&SqueezeV02
# Mobius
# V02.04.2020
#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.
# Revision: Added secondary aggregation to help determine overall trend. Trades when secondary aggregation is at extremes and primary aggregation signals a trade at extremes have a higher probablility of extended gains. A 10 times +- difference in aggregation between the chart aggregation and the seocndary aggregation gives adequate higher aggregation view of trend. Signal lines (vertical green lines) are plotted for long trades only. The indicator can be used as both a lower and upper study with all plots on the upper study converted to definitions and painting strategies commented out. Squeeze indicator was added to show areas of price compression. If squeeze is indicated and secondary aggregation stays in trend look for price to continue after exiting squeeze in same trend as prior to squeeze. If primary is rolling over or already at extremes the probility is much greater that there will be a polarity change once price exits the squeeze.
declare Lower;
input length = 14;
input calcLength = 5;
input smoothLength = 3;
input AvgType = AverageType.Hull;
input ColorCandles = no;
input secAgg = AggregationPeriod.Hour;
def RTH = getTime() >= RegularTradingStart(getYYYYMMDD()) and getTime() <= RegularTradingEnd(getYYYYMMDD());
def o = open;
def h = high;
def l = low;
def c = close;
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 = MovingAverage(AvgType, EMA5, smoothLength);
plot Signal = MovingAverage(AvgType, Main, smoothLength);
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();
Main.AssignValueColor(if Main > ob
then color.cyan
else if between(main, os, ob) and Main > Signal
then color.cyan
else if between(main, os, ob) and Main < Signal
then color.blue
else if Main < os
then color.blue
else color.blue);
Main.HideBubble();
Main.HideTitle();
Signal.AssignValueColor(if Main > ob
then color.cyan
else if between(main, os, ob) and Main > Signal
then color.cyan
else if between(main, os, ob) and Main < Signal
then color.blue
else if Main < os
then color.blue
else color.blue);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, color.cyan, color.blue);
addCloud(ob, length, color.light_green, color.light_green, no);
addCloud(-length, os, color.light_red, color.light_red);
AssignPriceColor(if ColorCandles and Main > Signal
then color.green
else if ColorCandles and Main < Signal
then color.red
else color.current);
plot squeeze = if(log(sum(TrueRange(h,c,l), 8) / (highest(h, 8) - lowest(l, 8))) / log(8) > .618, 0, double.nan);
squeeze.SetStyle(Curve.Points);
squeeze.SetLineWeight(3);
squeeze.SetDefaultColor(Color.Red);
squeeze.HideBubble();
squeeze.HideTitle();
addVerticalLine(RTH and Main crosses above os, "", color.green);
def o2 = open(period = secAgg);
def h2 = high(period = secAgg);
def l2 = low(period = secAgg);
def c2 = close(period = secAgg);
def data2 = fold i2 = 0 to length
with s2
do s2 + (if c2 > getValue(o2, i2)
then 1
else if c2 < getValue(o2, i2)
then - 1
else 0);
def EMA5_2 = ExpAverage(data2, calcLength);
plot Main_2 = if getTime() % secAgg == 0
then MovingAverage(AvgType, EMA5_2, smoothLength)
else double.nan;
Main_2.EnableApproximation();
Main_2.SetLineWeight(3);
Main_2.SetDefaultColor(Color.Yellow);
# End Code
per member request: @Phatrook
Last edited: