Rahul Mohindar Oscillator (RMO) Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
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:

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

New member
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

New member
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:

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:

Camelotnite

New member
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

Member
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.
 

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

Member
@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:

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
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Hi Do you guys have latest code for above one?
There isn't a single "current" version of the above indicator. Instead, members have shared several variations customized to suit different trading styles.

To become proficient in reading these scripts, the most effective method is to experiment with it firsthand. Nothing compares to hands-on experience, so add the indicator to your chart and observe how it operates in conjunction with your other indicators.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
95 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top