Rahul Mohindar Oscillator (RMO) Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Rich (BB code):
# from TOS Yahoo Groups

declare lower;

Plot RMOSW2 = ExpAverage(100 *

(Close - ((SimplemovingAvg(Close, 2) +

SimplemovingAvg(SimplemovingAvg(Close, 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2), 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2), 2), 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2), 2), 2), 2), 2), 2) +

SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(SimplemovingAvg(Close, 2), 2), 2), 2), 2), 2), 2), 2), 2), 2)) / 10)) /

(Highest(Close, 10) - Lowest(Close, 10)), 30);

Plot RMOSW3 = ExpAverage(RMOSW2, 30);

Plot Zeroline = 0;
 
Last edited:
L

Lenaka

New member
Hi, What is different for each of the "Close"?

For example, am I correct take it that the Close in "Close - ((SimplemovingAvg(Close, 2)" refers to today's close and the simple moving average takes's today's close and yesterday's close into account?

If my approach above is correct, then which close is the next leg of the formula "SimplemovingAvg(SimplemovingAvg(Close, 2), 2)" referring to?

Thank you,
 
Camelotnite

Camelotnite

New member
VIP
I've been using this RMO indicator for a while. If you follow the video (www.youtube.com/watch?v=FOI_cy2c8o0), it is actually made up of 3 waves (rainbow oscillator). short, mid and long term. The key signal is when all 3 waves are aligned in the same direction. For aggressive entries, you can trade with 2 waves aligned. Welcome any comments to improve this.

https://ibb.co/4swd2D4
 
Last edited:
Camelotnite

Camelotnite

New member
VIP
Code:
#==============

# Long term wave - This shows the trend

declare lower;

def RMO = 100*(CLOSE - ((Average(close,2) +

Average(Average(close,2),2) +

Average(Average(Average(close,2),2),2) +

Average(Average(Average(Average(close,2),2),2),2) +

Average(Average(Average(Average(Average(close,2),2),2),2),2) +

Average(Average(Average(Average(Average(Average(close,2),2),2),2),2),2) +

Average(Average(Average(Average(Average(Average(Average(close,2),2),2),2),2),2),2) +

Average(Average(Average(Average(Average(Average(Average(Average(close,2),2),2),2),2),2),2),2) +

Average(Average(Average(Average(Average(Average(Average(Average(Average(close,2),2),2),2),2),2),2),2),2) +

Average(Average(Average(Average(Average(Average(Average(Average(Average(Average(close,2),2),2),2),2),2),2),2),2),2)) / 10)) /

(Highest(close,10) - Lowest(close,10));

plot swingtrade = expaverage(RMO,81);

swingtrade.SetPaintingStrategy(paintingStrategy.HISTOGRAM);

swingtrade.SetLineWeight(3);

swingtrade.AssignValueColor(if swingtrade > 0 then color.CYAN else color.red);

#==============
 
Last edited by a moderator:
Camelotnite

Camelotnite

New member
VIP
Code:
#==============
# Mid and Short term waves - They create buy and sell signals
# translated from a Metastock script by rhouser
# set show RMO = no
declare lower;

input length = 2;
input rmoLength = 81;
input swingTrdLen = 30;
input showRMO = no;

def mva01 = MovingAverage( AverageType.SIMPLE, close, length );
def mva02 = MovingAverage( AverageType.SIMPLE, mva01, length );
def mva03 = MovingAverage( AverageType.SIMPLE, mva02, length );
def mva04 = MovingAverage( AverageType.SIMPLE, mva03, length );
def mva05 = MovingAverage( AverageType.SIMPLE, mva04, length );
def mva06 = MovingAverage( AverageType.SIMPLE, mva05, length );
def mva07 = MovingAverage( AverageType.SIMPLE, mva06, length );
def mva08 = MovingAverage( AverageType.SIMPLE, mva07, length );
def mva09 = MovingAverage( AverageType.SIMPLE, mva08, length );
def mva10 = MovingAverage( AverageType.SIMPLE, mva09, length );

def RMO = ( close - ( ( mva01 + mva02 + mva03 + mva04 + mva05 + mva06 + mva07 + mva08 + mva09 + mva10 ) / 10 ) ) / ( Highest( close, 10 ) - Lowest( close, 10 ) );

plot Swingtrade = MovingAverage( AverageType.EXPONENTIAL, RMO, rmoLength );
plot SwingTrd2 = MovingAverage( AverageType.EXPONENTIAL, RMO, swingTrdLen );
plot SwingTrd3 = MovingAverage( AverageType.EXPONENTIAL, SwingTrd2, swingTrdLen );
plot ZeroLine = 0;

#===============================[ Look & Feel ]================================
Swingtrade.SetPaintingStrategy( PaintingStrategy.HISTOGRAM );
Swingtrade.SetDefaultColor( Color.GREEN );
Swingtrade.SetLineWeight( 3 );
Swingtrade.SetHiding( !showRMO );
SwingTrd2.SetPaintingStrategy( PaintingStrategy.HISTOGRAM );
SwingTrd2.SetDefaultColor( Color.MAGENTA );
SwingTrd2.SetLineWeight( 3 );
SwingTrd2.SetHiding( showRMO );
SwingTrd3.SetPaintingStrategy( PaintingStrategy.LINE );
SwingTrd3.SetDefaultColor( Color.CYAN );
SwingTrd3.SetLineWeight( 1 );
SwingTrd3.SetHiding( showRMO );
SwingTrd3.AssignValueColor(if SwingTrd3 > 0 then Color.CYAN else Color.RED);
ZeroLine.SetDefaultColor( Color.BLACK );

# buy and sell conditions
def buy = if SwingTrd2 crosses above SwingTrd3 and SwingTrd3[0] > SwingTrd3[1] and SwingTrd3 > 0 then 1
else if SwingTrd3 crosses above 0 and SwingTrd3[0] > SwingTrd3[1] and SwingTrd3 > 0 then 1
else if SwingTrd2 crosses above 0 and SwingTrd3[0] > SwingTrd3[1] and SwingTrd3 > 0 then 1
else double.Nan;

def sell = if SwingTrd2 crosses below SwingTrd3 and swingtrade < 0 and swingtrade[0] < swingtrade[1] and low[0] < low[1] then 1
else if SwingTrd3 crosses below 0 and swingtrade < 0 and swingtrade[0] < swingtrade[1] and low[0] < low[1] then 1
else if SwingTrd2 crosses below 0 and swingtrade < 0 and swingtrade[0] < swingtrade[1] and low[0] < low[1] then 1
else double.Nan;

# def Bull = SwingTrd2 crosses above SwingTrd3 and RMO > 0;
# def Bear = SwingTrd3 crosses above SwingTrd2 and RMO < 0;
AddVerticalLine(Buy , "Up", Color.UPTICK);
AddVerticalLine(Sell, "Down", Color.LIGHT_RED);
#==============
 
Last edited by a moderator:
S

skynetgen

Well-known member
Just wanted comment of those kind of oscillators: The best thing about them compared to standard RSI/MACD etc is multiple timeframe confluence. By using multiple length on single main timeframe you get MTF signal. - The trick is fine tuning length to your criteria and setups. Especially tricky is the understanding the state of market (chop/trend/washout) and how these indicators behave in those.
Simple MTF rsi is more powerful than single timeframe RSI, but at same time much harder to use effectively.

The worst part about them is it is very hard to determine what exactly they measure. For example I have hard time figuring out what exactly is the point of this RMO calculations? (smoothing? decycling?)
 
Last edited:
blakecmathis

blakecmathis

Well-known member
I've been using this RMO indicator for a while. If you follow the video (www.youtube.com/watch?v=FOI_cy2c8o0), it is actually made up of 3 waves (rainbow oscillator). short, mid and long term. The key signal is when all 3 waves are aligned in the same direction. For aggressive entries, you can trade with 2 waves aligned. Welcome any comments to improve this.

https://ibb.co/4swd2D4
How would I go about removing the up/down signals from the code?
 
Camelotnite

Camelotnite

New member
VIP
How would I go about removing the up/down signals from the code?
Just wanted comment of those kind of oscillators: The best thing about them compared to standard RSI/MACD etc is multiple timeframe confluence. By using multiple length on single main timeframe you get MTF signal. - The trick is fine tuning length to your criteria and setups. Especially tricky is the understanding the state of market (chop/trend/washout) and how these indicators behave in those.
Simple MTF rsi is more powerful than single timeframe RSI, but at same time much harder to use effectively.

The worst part about them is it is very hard to determine what exactly they measure. For example I have hard time figuring out what exactly is the point of this RMO calculations? (smoothing? decycling?)
I use this to give me sense of market direction and momentum. The entries and exits depends highly on price action.
 
lowtrade

lowtrade

Member
VIP
I have seen the below RMO indicator and looks good. Can anyone make a scan code to find all the stocks crossed above zero in the last one or two bars? I'm not a coder so any help would be appreciated.
 
T

tradebyday

Active member
Took the two RMO indicators provided by @Camelotnite and integrated them into the "impulse" format to be used as a trend painter for the candlesticks while not clogging the chart and allowing more indicators to be used
Code:
#Impulse modified to use RMO Short Term and Long Term in confluence
#ImpulseRMOLST by Tradebyday

#==============
# Mid and Short term waves - They create buy and sell signals
# translated from a Metastock script by rhouser
# set show RMO = no

input length = 2;
input rmoLength = 81;
input swingTrdLen = 30;
input showRMO = no;

def mva01 = MovingAverage( AverageType.SIMPLE, close, length );
def mva02 = MovingAverage( AverageType.SIMPLE, mva01, length );
def mva03 = MovingAverage( AverageType.SIMPLE, mva02, length );
def mva04 = MovingAverage( AverageType.SIMPLE, mva03, length );
def mva05 = MovingAverage( AverageType.SIMPLE, mva04, length );
def mva06 = MovingAverage( AverageType.SIMPLE, mva05, length );
def mva07 = MovingAverage( AverageType.SIMPLE, mva06, length );
def mva08 = MovingAverage( AverageType.SIMPLE, mva07, length );
def mva09 = MovingAverage( AverageType.SIMPLE, mva08, length );
def mva10 = MovingAverage( AverageType.SIMPLE, mva09, length );

def RMO = ( close - ( ( mva01 + mva02 + mva03 + mva04 + mva05 + mva06 + mva07 + mva08 + mva09 + mva10 ) / 10 ) ) / ( Highest( close, 10 ) - Lowest( close, 10 ) );

def Swingtrade = MovingAverage( AverageType.EXPONENTIAL, RMO, rmoLength );
def SwingTrd2 = MovingAverage( AverageType.EXPONENTIAL, RMO, swingTrdLen );
def SwingTrd3 = MovingAverage( AverageType.EXPONENTIAL, SwingTrd2, swingTrdLen );
def ZeroLine = 0;


# buy and sell conditions
def buy = if SwingTrd2 crosses above SwingTrd3 and SwingTrd3[0] > SwingTrd3[1] and SwingTrd3 > 0 then 1
else if SwingTrd3 crosses above 0 and SwingTrd3[0] > SwingTrd3[1] and SwingTrd3 > 0 then 1
else if SwingTrd2 crosses above 0 and SwingTrd3[0] > SwingTrd3[1] and SwingTrd3 > 0 then 1
else Double.NaN;

def sell = if SwingTrd2 crosses below SwingTrd3 and Swingtrade < 0 and Swingtrade[0] < Swingtrade[1] and low[0] < low[1] then 1
else if SwingTrd3 crosses below 0 and Swingtrade < 0 and Swingtrade[0] < Swingtrade[1] and low[0] < low[1] then 1
else if SwingTrd2 crosses below 0 and Swingtrade < 0 and Swingtrade[0] < Swingtrade[1] and low[0] < low[1] then 1
else Double.NaN;

#==============

#==============

# Long term wave - This shows the trend


def RMO2 = 100 * (close - ((Average(close, 2) +

Average(Average(close, 2), 2) +

Average(Average(Average(close, 2), 2), 2) +

Average(Average(Average(Average(close, 2), 2), 2), 2) +

Average(Average(Average(Average(Average(close, 2), 2), 2), 2), 2) +

Average(Average(Average(Average(Average(Average(close, 2), 2), 2), 2), 2), 2) +

Average(Average(Average(Average(Average(Average(Average(close, 2), 2), 2), 2), 2), 2), 2) +

Average(Average(Average(Average(Average(Average(Average(Average(close, 2), 2), 2), 2), 2), 2), 2), 2) +

Average(Average(Average(Average(Average(Average(Average(Average(Average(close, 2), 2), 2), 2), 2), 2), 2), 2), 2) +

Average(Average(Average(Average(Average(Average(Average(Average(Average(Average(close, 2), 2), 2), 2), 2), 2), 2), 2), 2), 2)) / 10)) /

(Highest(close, 10) - Lowest(close, 10));

def swingtrade4 = ExpAverage(RMO, 81);

#==============


def GreenPrice = Swingtrd2 > 0 and swingtrade4 > 0;
def RedPrice = Swingtrd2 < 0 and swingtrade4 < 0;

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if GreenPrice then GlobalColor("Bullish") else if RedPrice then GlobalColor("Bearish") else GlobalColor("Neutral"));
 
lowtrade

lowtrade

Member
VIP
@tradebyday Would it be possible for you to make a scan for this indicator? I really love this one.

When do we get the green bullish candle? I'm seeing only red and blue even when it is crossing above zero line.
 
Last edited:
T

tradebyday

Active member
@lowtrade The green bullish candle appears (if you have both of the RMO's shared by camelotnite on screen as reference) when both histograms are above 0. then bearish red candles when both histograms are under 0. Blue occurs when they are not in agreement with each other. I forgot to do this before I uploaded the code, but if you edit the source code for the indicator I shared, third line from the bottom you can replace the word "BLUE" with "GRAY" for a much better visual representation of neutral. Also, I am not too familiar with making scans as I mostly day trade /ES, but maybe someone else could make it happen
 
F

fpapedo

New member
VIP
@Camelotnite My long term histogram and mid/short term plot the same on all times, I'm I doing something wrong?
 
Top