Romi Trend and Momentum Oscillator For ThinkOrSwim

mbarcala

Active member
Another simple indicator from TradingView converted to TOS, Enjoy!

Upper Indicator: https://usethinkscript.com/threads/break-keltner-bands-bkb-for-thinkorswim.11220/
Lower Indicator: https://usethinkscript.com/threads/romi-trend-and-momentum-oscillator-for-thinkorswim.10207/
Photo
13502[/ATTACH]']
iZTKusa.png


script
Code:
# Trend and Momentum Oscillator from TadingView converted by mbarcala
#Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/
#study(title = "Romi Trend and Momentum Oscillator", shorttitle="ROMI")

declare lower;

input length = 20;
input slength = 6;

plot s2 = ExpAverage(close, slength) - ExpAverage(close, length);
s2.AssignValueColor(if s2 > 0 then Color.GREEN else if s2 < 0 then Color.RED else Color.CURRENT);
s2.SetLineWeight(2);
s2.HideBubble();

plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
 

Attachments

  • iZTKusa.png
    iZTKusa.png
    191 KB · Views: 158
Last edited by a moderator:
Another simple indicator from TradingView converted to TOS, Enjoy!
Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/

Photo
13645[/ATTACH]']
iZTKusa.png


script
Code:
# Trend and Momentum Oscillator from TadingView converted by mbarcala
#Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/
#study(title = "Romi Trend and Momentum Oscillator", shorttitle="ROMI")

declare lower;

input length = 20;
input slength = 6;

plot s2 = ExpAverage(close, slength) - ExpAverage(close, length);
s2.AssignValueColor(if s2 > 0 then Color.GREEN else if s2 < 0 then Color.RED else Color.CURRENT);
s2.SetLineWeight(2);
s2.HideBubble();

plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
This indicator just shows the difference between the 2 EMA's. here is a version that adds clouds, a signal line , dev bands , arrows, and paintbars
Code:
# Trend and Momentum Oscillator from TadingView converted by mbarcala
#Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/
#study(title = "Romi Trend and Momentum Oscillator", shorttitle="ROMI")

declare lower;

input length = 20;
input slength = 6;
input SigLength = 3;
input arrows = 0;
input dotsize = 3;
input APC = 0;
plot s2 = ExpAverage(close, slength) - ExpAverage(close, length);
s2.setdefaultColor(Color.Cyan);
s2.SetLineWeight(2);
s2.HideBubble();
Plot Signal = ExpAverage(s2,Siglength);
Signal.SetdefaultColor(Color.Magenta);
signal.SetLineWeight(2);
plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
AddCloud(S2,Signal,Color.Cyan,Color.Magenta);
def Mmax= Max(S2,Signal);
def MMin= Min(S2,Signal);
AddCloud(MMin,0,Color.green,Color.Black);
AddCloud(Mmax,0,Color.Black,Color.Red);
Def Con1 = s2 >= 0;
Def Con2 = s2 < 0;
Def Con3 = s2 > s2[1];
Def Con4 = s2 < s2[1];

Plot BullRise = If Con1 and Con3 then MMin else 0;
BullRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BullRise.SetDefaultColor(Color.Green);
BullRise.SetLineWeight(3);
Plot BullFall = if Con1 and Con4 then MMin else 0;
BullFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BullFall.SetDefaultColor(Color.Dark_Green);
BullFall.SetLineWeight(3);
Plot BearFall = if Con2 and Con4 then MMax else 0;
BearFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BearFall.SetDefaultColor(Color.Dark_Red);
BearFall.SetLineWeight(3);
Plot BearRise = if Con2 and Con3 then Mmax else 0;
BearRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BearRise.SetDefaultColor(Color.Red);
BEarRise.SetLineWeight(3);

Plot UZ = Average(s2,34) + (1.3185*StDev(s2,34));
UZ.SetPaintingStrategy(PaintingStrategy.Line);
UZ.SetLineWeight(2);
UZ.SetDefaultColor(Color.Yellow);
Plot LZ = Average(s2,34) - (1.3185*StDev(s2,34));
LZ.SetPaintingStrategy(PaintingStrategy.Line);
LZ.SetLineWeight(2);
LZ.SetDefaultColor(Color.Yellow);

#ARROWS
plot ArrowDown = if arrows and (s2 Crosses below Signal) then Signal else double.nan;
ArrowDown.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown.setDefaultColor(color.Magenta);
ArrowDown.setLineWeight(dotsize);

plot ArrowUp = if arrows and (s2 crosses above Signal) then signal else double.nan;
ArrowUp.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp.setDefaultColor(color.Cyan);
ArrowUp.setLineWeight(dotsize);

plot ArrowDown2 = if arrows and (s2 Crosses below 0) then 0 else double.nan;
ArrowDown2.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown2.setDefaultColor(color.Red);
ArrowDown2.setLineWeight(dotsize);

plot ArrowUp2 = if arrows and (s2 crosses above 0 ) then 0 else double.nan;
ArrowUp2.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp2.setDefaultColor(color.Blue);
ArrowUp2.setLineWeight(dotsize);

plot ArrowDown3 = if arrows and (s2 Crosses below UZ) then UZ else double.nan;
ArrowDown3.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown3.setDefaultColor(color.Yellow);
ArrowDown3.setLineWeight(dotsize);

plot ArrowUp3 = if arrows and (s2 crosses above LZ ) then LZ else double.nan;
ArrowUp3.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp3.setDefaultColor(color.Yellow);
ArrowUp3.setLineWeight(dotsize);

AssignPriceColor( if APC ==1 and s2 >= signal then Color.Cyan else if APC == 1 and s2 < Signal then Color.Magenta else If APC ==2 and s2 >=0 then Color.Green else If APC ==2 and s2 <0 then Color.Red else Color.Current);
 

Attachments

  • iZTKusa.png
    iZTKusa.png
    191 KB · Views: 117
This indicator just shows the difference between the 2 EMA's. here is a version that adds clouds, a signal line , dev bands , arrows, and paintbars
Code:
# Trend and Momentum Oscillator from TadingView converted by mbarcala
#Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/
#study(title = "Romi Trend and Momentum Oscillator", shorttitle="ROMI")

declare lower;

input length = 20;
input slength = 6;
input SigLength = 3;
input arrows = 0;
input dotsize = 3;
input APC = 0;
plot s2 = ExpAverage(close, slength) - ExpAverage(close, length);
s2.setdefaultColor(Color.Cyan);
s2.SetLineWeight(2);
s2.HideBubble();
Plot Signal = ExpAverage(s2,Siglength);
Signal.SetdefaultColor(Color.Magenta);
signal.SetLineWeight(2);
plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
AddCloud(S2,Signal,Color.Cyan,Color.Magenta);
def Mmax= Max(S2,Signal);
def MMin= Min(S2,Signal);
AddCloud(MMin,0,Color.green,Color.Black);
AddCloud(Mmax,0,Color.Black,Color.Red);
Def Con1 = s2 >= 0;
Def Con2 = s2 < 0;
Def Con3 = s2 > s2[1];
Def Con4 = s2 < s2[1];

Plot BullRise = If Con1 and Con3 then MMin else 0;
BullRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BullRise.SetDefaultColor(Color.Green);
BullRise.SetLineWeight(3);
Plot BullFall = if Con1 and Con4 then MMin else 0;
BullFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BullFall.SetDefaultColor(Color.Dark_Green);
BullFall.SetLineWeight(3);
Plot BearFall = if Con2 and Con4 then MMax else 0;
BearFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BearFall.SetDefaultColor(Color.Dark_Red);
BearFall.SetLineWeight(3);
Plot BearRise = if Con2 and Con3 then Mmax else 0;
BearRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BearRise.SetDefaultColor(Color.Red);
BEarRise.SetLineWeight(3);

Plot UZ = Average(s2,34) + (1.3185*StDev(s2,34));
UZ.SetPaintingStrategy(PaintingStrategy.Line);
UZ.SetLineWeight(2);
UZ.SetDefaultColor(Color.Yellow);
Plot LZ = Average(s2,34) - (1.3185*StDev(s2,34));
LZ.SetPaintingStrategy(PaintingStrategy.Line);
LZ.SetLineWeight(2);
LZ.SetDefaultColor(Color.Yellow);

#ARROWS
plot ArrowDown = if arrows and (s2 Crosses below Signal) then Signal else double.nan;
ArrowDown.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown.setDefaultColor(color.Magenta);
ArrowDown.setLineWeight(dotsize);

plot ArrowUp = if arrows and (s2 crosses above Signal) then signal else double.nan;
ArrowUp.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp.setDefaultColor(color.Cyan);
ArrowUp.setLineWeight(dotsize);

plot ArrowDown2 = if arrows and (s2 Crosses below 0) then 0 else double.nan;
ArrowDown2.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown2.setDefaultColor(color.Red);
ArrowDown2.setLineWeight(dotsize);

plot ArrowUp2 = if arrows and (s2 crosses above 0 ) then 0 else double.nan;
ArrowUp2.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp2.setDefaultColor(color.Blue);
ArrowUp2.setLineWeight(dotsize);

plot ArrowDown3 = if arrows and (s2 Crosses below UZ) then UZ else double.nan;
ArrowDown3.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown3.setDefaultColor(color.Yellow);
ArrowDown3.setLineWeight(dotsize);

plot ArrowUp3 = if arrows and (s2 crosses above LZ ) then LZ else double.nan;
ArrowUp3.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp3.setDefaultColor(color.Yellow);
ArrowUp3.setLineWeight(dotsize);

AssignPriceColor( if APC ==1 and s2 >= signal then Color.Cyan else if APC == 1 and s2 < Signal then Color.Magenta else If APC ==2 and s2 >=0 then Color.Green else If APC ==2 and s2 <0 then Color.Red else Color.Current);
show a picture?
 
This indicator just shows the difference between the 2 EMA's. here is a version that adds clouds, a signal line , dev bands , arrows, and paintbars
Code:
# Trend and Momentum Oscillator from TadingView converted by mbarcala
#Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/
#study(title = "Romi Trend and Momentum Oscillator", shorttitle="ROMI")

declare lower;

input length = 20;
input slength = 6;
input SigLength = 3;
input arrows = 0;
input dotsize = 3;
input APC = 0;
plot s2 = ExpAverage(close, slength) - ExpAverage(close, length);
s2.setdefaultColor(Color.Cyan);
s2.SetLineWeight(2);
s2.HideBubble();
Plot Signal = ExpAverage(s2,Siglength);
Signal.SetdefaultColor(Color.Magenta);
signal.SetLineWeight(2);
plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
AddCloud(S2,Signal,Color.Cyan,Color.Magenta);
def Mmax= Max(S2,Signal);
def MMin= Min(S2,Signal);
AddCloud(MMin,0,Color.green,Color.Black);
AddCloud(Mmax,0,Color.Black,Color.Red);
Def Con1 = s2 >= 0;
Def Con2 = s2 < 0;
Def Con3 = s2 > s2[1];
Def Con4 = s2 < s2[1];

Plot BullRise = If Con1 and Con3 then MMin else 0;
BullRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BullRise.SetDefaultColor(Color.Green);
BullRise.SetLineWeight(3);
Plot BullFall = if Con1 and Con4 then MMin else 0;
BullFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BullFall.SetDefaultColor(Color.Dark_Green);
BullFall.SetLineWeight(3);
Plot BearFall = if Con2 and Con4 then MMax else 0;
BearFall.SetPaintingStrategy(PaintingStrategy.Histogram);
BearFall.SetDefaultColor(Color.Dark_Red);
BearFall.SetLineWeight(3);
Plot BearRise = if Con2 and Con3 then Mmax else 0;
BearRise.SetPaintingStrategy(PaintingStrategy.Histogram);
BearRise.SetDefaultColor(Color.Red);
BEarRise.SetLineWeight(3);

Plot UZ = Average(s2,34) + (1.3185*StDev(s2,34));
UZ.SetPaintingStrategy(PaintingStrategy.Line);
UZ.SetLineWeight(2);
UZ.SetDefaultColor(Color.Yellow);
Plot LZ = Average(s2,34) - (1.3185*StDev(s2,34));
LZ.SetPaintingStrategy(PaintingStrategy.Line);
LZ.SetLineWeight(2);
LZ.SetDefaultColor(Color.Yellow);

#ARROWS
plot ArrowDown = if arrows and (s2 Crosses below Signal) then Signal else double.nan;
ArrowDown.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown.setDefaultColor(color.Magenta);
ArrowDown.setLineWeight(dotsize);

plot ArrowUp = if arrows and (s2 crosses above Signal) then signal else double.nan;
ArrowUp.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp.setDefaultColor(color.Cyan);
ArrowUp.setLineWeight(dotsize);

plot ArrowDown2 = if arrows and (s2 Crosses below 0) then 0 else double.nan;
ArrowDown2.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown2.setDefaultColor(color.Red);
ArrowDown2.setLineWeight(dotsize);

plot ArrowUp2 = if arrows and (s2 crosses above 0 ) then 0 else double.nan;
ArrowUp2.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp2.setDefaultColor(color.Blue);
ArrowUp2.setLineWeight(dotsize);

plot ArrowDown3 = if arrows and (s2 Crosses below UZ) then UZ else double.nan;
ArrowDown3.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown3.setDefaultColor(color.Yellow);
ArrowDown3.setLineWeight(dotsize);

plot ArrowUp3 = if arrows and (s2 crosses above LZ ) then LZ else double.nan;
ArrowUp3.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp3.setDefaultColor(color.Yellow);
ArrowUp3.setLineWeight(dotsize);

AssignPriceColor( if APC ==1 and s2 >= signal then Color.Cyan else if APC == 1 and s2 < Signal then Color.Magenta else If APC ==2 and s2 >=0 then Color.Green else If APC ==2 and s2 <0 then Color.Red else Color.Current);
Nice indicator. Can you share the TOS link? Thanks,
 
Another simple indicator from TradingView converted to TOS, Enjoy!
Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/

Photo
14774[/ATTACH]']
iZTKusa.png


script
Code:
# Trend and Momentum Oscillator from TadingView converted by mbarcala
#Original Link: https://www.tradingview.com/script/8bJ87hfP-Romi-Trend-and-Momentum-Oscillator/
#study(title = "Romi Trend and Momentum Oscillator", shorttitle="ROMI")

declare lower;

input length = 20;
input slength = 6;

plot s2 = ExpAverage(close, slength) - ExpAverage(close, length);
s2.AssignValueColor(if s2 > 0 then Color.GREEN else if s2 < 0 then Color.RED else Color.CURRENT);
s2.SetLineWeight(2);
s2.HideBubble();

plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
Nice indicator. Can you share the TOS link? Thanks,
 

Attachments

  • iZTKusa.png
    iZTKusa.png
    191 KB · Views: 110
Click on the beaker, then click on the gear wheel, Arrows has 3 selections 1 thru 3 , zero hides the arrows
APC Assign Price Color has 2 selections with zero being the hide function
 

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
408 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.
Back
Top