Repaints MTF TMO SCALPER For ThinkOrSwim

Repaints

eagle_ai

Member
Author states: TMO Scalper is a special custom version of the popular TMO Oscillator. Scalper version was designed specifically for the lower time frames (1-5min intraday scalps). This version prints in the signals directly on top of the oscillator only when the higher aggregations are aligned with the current aggregation (the big wheels must be spinning in order for a small wheel to spin). The scalper consist of three MTF TMO oscillators. First one is the one that plot signals (should be the fastest aggregation), second serves as a short term trend gauge (good rule of thumb is to us 2-5x of the chart time frame or the first aggregation). The third one (optional) is shaded in the background & should only serve as a trend gauge for the day (usually higher time frames 30min+).

Time Frames Preffered by Traders:

1. 1m / 5m / 30m - This one is perfect for catching the fastest moves. However, during choppy days the 1min can produce more false signals..
2. 2m / 10m / 30m - Healthy middle, the 2min aggregation nicely smooths out the 1min mess. Short term gauge is turning slowly (10min for a signal to confirm).
3. 3m / 30m / 60m - This TF is awesome for day traders that prefer to take it slow. Obviously, this combination will produce far less signals during the day.


fpVhZKN.png


original Tradingview code:
https://www.tradingview.com/script/LOPtZGaw-TMO-Scalper/
New ToS code can be found in the next post
 
Last edited by a moderator:
  • I'm watching this!
Reactions: sum
check the below. Original code uses lower time frame which not supported by TOS, but this is the closest you can get.

CSS:
#// Indicator forTOS
#// TMO (T)rue (M)omentum (O)scillator) MTF Special Scapler Version
#// TMO Scalper is a special custom version that was designed exclusively for lower time frame scalps (1-5min charts)
#// This version of the TMO Oscillator print the signals ONLY when the higher aggregation is aligned with the current (lower aggregation)
#// Created by L&L Capital
#indicator("TMO Scalper", shorttitle="TMO Scalper", overlay=false)
# Converted by Sam4Cok@Samer800    - 09/2024
declare lower;

input Timeframe1 = AggregationPeriod.MIN;
input Timeframe2 = AggregationPeriod.FIFTEEN_MIN;
input Timeframe3 = AggregationPeriod.THIRTY_MIN;
input tmoLength = 14; #,title = "Length", group = "Settings")
input calcLength = 5; #, title = "Calc Length", group = "Settings")
input smoothLength = 3; #, title = "Smooth Length", group = "Settings")
input offset = 2; #,title = "Signal Offset", group = "Signal Settings")
input obLevel = 9; #,title = "OB Extreme Threshold", group = "Signal Settings")
input osLevel = -9; #,title = "OS Extreme Threshold", group = "Signal Settings")
input ShowTMO1 = yes; #, title = "Show TMO 1", group = "True Momentum Oscillator 1")
input ShowTMO2 = yes; #, title = "Show TMO 2", group = "True Momentum Oscillator 2")
input ShowTMO3 = yes; #, title = "Show TMO 3", group = "True Momentum Oscillator 3")
input showSignal1 = yes; # title = "Show TMO 1 Signals", group = "True Momentum Oscillator 1 Signals")
input ShowTmoExt1 = no; # "Show TMO 1 Signals (Extremes Only)"
input showSignal2 = yes; # "Show TMO 2 Signals"
input ShowTmoExt2 = no; # "Show TMO 2 Signals (Extremes Only)"

def na = Double.NaN;
def last = IsNaN(close);
def current = GetAggregationPeriod();
def tf1 = Max(current, TimeFrame1);
def tf2 = Max(current, TimeFrame2);
def tf3 = Max(current, TimeFrame3);

#// TMO 1 Calculations
def data1 = fold i1=1 to tmolength with p1 do
            if close(Period=tf1) > open(Period=tf1)[i1] then p1 + 1 else
            if close(Period=tf1) < open(Period=tf1)[i1] then p1 - 1 else p1;
def EMA1 = ExpAverage(data1,calcLength);
def Main1 = ExpAverage(EMA1, smoothLength);
def Signal1 = ExpAverage(Main1, smoothLength);

#// TMO 2 Calculations
def data2 = fold i2=1 to tmolength with p2 do
            if close(Period=tf2) > open(Period=tf2)[i2] then p2 + 1 else
            if close(Period=tf2) < open(Period=tf2)[i2] then p2 - 1 else p2;
def EMA2 = ExpAverage(data2,calcLength);
def Main2 = ExpAverage(EMA2, smoothLength);
def Signal2 = ExpAverage(Main2, smoothLength);

#// TMO 3 Calculations
def data3 = fold i3=1 to tmolength with p3 do
            if close(Period=tf3) > open(Period=tf3)[i3] then p3 + 1 else
            if close(Period=tf3) < open(Period=tf3)[i3] then p3 - 1 else p3;
def EMA3 = ExpAverage(data3,calcLength);
def Main3 = ExpAverage(EMA3, smoothLength);
def Signal3 = ExpAverage(Main3, smoothLength);

#// TMO Scalper Signals
def mainln1  = (15 * Main1   /tmolength);
def signaln1 = (15 * Signal1 /tmolength);
def mainln2  = (15 * Main2   /tmolength);
def signaln2 = (15 * Signal2 /tmolength);
def mainln3  = (15 * Main3   /tmolength);
def signaln3 = (15 * Signal3 /tmolength);
def cross1Up = (mainln1 > signaln1) and (mainln1[1] <= signaln1[1]);
def cross1Dn = (signaln1 > mainln1) and (signaln1[1] <= mainln1[1]);
def cross2Up = (mainln2 > signaln2) and (mainln2[1] <= signaln2[1]);
def cross2Dn = (signaln2 > mainln2) and (signaln2[1] <= mainln2[1]);

def tmo1B = if showSignal1 and cross1Up and (mainln2 > signaln2) then (mainln1-offset) else na;
def tmo1S = if showSignal1 and cross1Dn and (mainln2 < signaln2) then (mainln1+offset) else na;
def tmo1ExtB = if ShowTmoExt1 and cross1Up and (mainln1 < oslevel) and (mainln2 > signaln2)
                then (mainln1-offset) else na;
def tmo1ExtS = if ShowTmoExt1 and cross1Dn and (mainln1 > oblevel) and (mainln2 < signaln2)
                then (mainln1+offset) else na;
def tmo2B = if showSignal2 and cross2Up and (mainln3 > signaln3) then (mainln2-offset) else na;
def tmo2S = if showSignal2 and cross2Dn and (mainln3 < signaln3) then (mainln2+offset) else na;
def tmo2ExtB = if ShowTmoExt2 and cross2Up and (mainln2 < oslevel) and (mainln3 > signaln3)
                then (mainln2-offset) else na;
def tmo2ExtS = if ShowTmoExt2 and cross2Dn and (mainln2 > oblevel) and (mainln3 < signaln3)
                then (mainln2+offset) else na;
plot tmo1Bull = tmo1B;
plot tmo1Bear = tmo1S;
plot tmo1ExtBull = tmo1ExtB;
plot tmo1ExtBear = tmo1ExtS;
plot tmo2Bull = tmo2B;
plot tmo2Bear = tmo2S;
plot tmo2ExtBull = tmo2ExtB;
plot tmo2ExtBear = tmo2ExtS;
tmo1Bull.SetDefaultColor(Color.GREEN);
tmo1Bear.SetDefaultColor(Color.RED);
tmo2Bull.SetDefaultColor(Color.CYAN);
tmo2Bear.SetDefaultColor(Color.MAGENTA);
tmo1Bull.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
tmo1Bear.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
tmo1ExtBull.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
tmo1ExtBear.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
tmo2Bull.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
tmo2Bear.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
tmo2ExtBull.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
tmo2ExtBear.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

#--plots
def mainLine1   = if ShowTMO1 and !last then mainln1 else na; # "TMO 1 Main"
def signalLine1 = if ShowTMO1 and !last then signaln1 else na; # "TMO 1 Signal"
def mainLine2   = if ShowTMO2 and !last then mainln2 else na; # "TMO 1 Main"
def signalLine2 = if ShowTMO2 and !last then signaln2 else na; # "TMO 1 Signal"
def mainLine3   = if ShowTMO3 and !last then mainln3 else na; # "TMO 1 Main"
def signalLine3 = if ShowTMO3 and !last then signaln3 else na; # "TMO 1 Signal"

AddCloud(mainLine1, signalLine1, Color.GREEN, Color.RED, yes);
AddCloud(mainLine2, signalLine2, Color.CYAN, Color.MAGENTA, yes);
AddCloud(mainLine3, signalLine3, Color.WHITE, Color.YELLOW, yes);

#-- Levels
plot Extob = if last then na else 15;
def ob = if last then na else 10;
plot Extos = if last then na else -15;
def os = if last then na else -10;

Extob.SetDefaultColor(Color.RED);
Extos.SetDefaultColor(Color.GREEN);

AddCloud(Extob, ob, Color.DARK_RED);
AddCloud(os, Extos, Color.DARK_GREEN);

#-- END of CODE
 

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
411 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