Repaints TTM_ScalperAlert for ThinkorSwim

Repaints
You probably want to read through the whole thread to understand the myriad of problems associated with this indicator.
In answer to your question, yes other members have documented the problem of not updating in real time.
https://usethinkscript.com/threads/ttm_scalperalert-for-thinkorswim.914/#post-47967
draw9300 said:
Is there any mention of why the Mobius candle count horizontal pivot script seems to have issues loading on the larger timeframes like a 15m? I'll be viewing it a certain way and then hours later realize it hasn't loaded like 3-4 of the latest lines on the count.

This adds a portion of Mobius' Projection Pivots to this Scalper script to activate the realtime updating of the pivots. This has been used on other indicators using Mobius' Pivot code as a basis.

Remember that this Scalper Replica will not create a pivot until the pivot is formed by the input n (length) on both sides of the pivot. So if you set the length to the default length of 8, then the pivot will plot at the earliest when 8 bars past the pivot have closed.

The image and the link https://tos.mx/oPNNH5K show both the Replica and actual ScalperAlert indicators, which usually plots an arrow before the Replica plots the pivot.

Screenshot-2023-02-11-095627.png
Code:
# Mobius
# Mobius on My Trade
# TTM Scalper Replica or High_Low_Pivots
# V001.06.2012
# jpwel added alerts 06/26/2015
# Sleepyz: added highpivots/lowpivots code from Mobius Projection
#   Pivots to activate realtime plotting of pivots

input n = 8;
input ShowLines = yes;
input SoundAlerts = yes;

def h = high;
def l = low;
def Firstbar = BarNumber();
def Highest = fold i = 1
             to n + 1
             with p = 1
             while p
             do h > GetValue(h, -i);
def A = if (Firstbar > n
            and h == Highest(h, n)
            and Highest)
            then h
            else Double.NaN;
def Lowest = fold j = 1
            to n + 1
            with q = 1
            while q
            do l < GetValue(l, -j);
def B = if (Firstbar > n
            and l == Lowest(l, n)
            and Lowest)
            then l
            else Double.NaN;
rec Al = if !IsNaN(A)
             then A
             else Al[1];
rec Bl = if !IsNaN(B)
             then B
             else Bl[1];

#### Code added to activate realtime updating pf Pivots

def PHBar    = if !IsNaN(A)
               then Firstbar
               else PHBar[1];

def PLBar    = if !IsNaN(B)
               then Firstbar
               else PLBar[1];

def priorPHBar = if Al != Al[1]
                 then PHBar[1]
                 else priorPHBar[1];

def priorPLBar = if Bl != Bl[1]
                 then PLBar[1]
                 else priorPLBar[1];

def HighPivots = Firstbar >= HighestAll(priorPHBar);
def LowPivots  = Firstbar >= HighestAll(priorPLBar);


#################


plot ph = Round(A, 2);
ph.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot hL = if Al > 0 or HighPivots
                       then Al
                       else Double.NaN;
hL.SetHiding(!ShowLines);
hL.SetPaintingStrategy(PaintingStrategy.DASHES);
hL.SetDefaultColor(Color.GREEN);

plot pl = Round(B, 2);
pl.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot ll = if Bl > 0 or LowPivots
                      then Bl
                      else Double.NaN;
ll.SetHiding(!ShowLines);
ll.SetPaintingStrategy(PaintingStrategy.DASHES);
ll.SetDefaultColor(Color.RED);
 
Last edited:
I wanted to post and update about the Mobius TTM Scalper code.
So, I understand that this indicator repaints by looking at the future bars. My question is how many bars in the future does it look (or rather wait to form) until it repaints the pivot in the past?
It looks like the line:
input n = 8;
controls the amount of future bars that the indicator looks at.
Is this correct?
The input n is the deciding factor on how many bars will be looked at. If you use this to look at historical data, it will provide very promising results that cannot be matched in real time (because it repaints).

The code is still useful for determining trends, but I do not use this for an entry/exit point.
 
ttm scalper alerts not sending alert to my phone or anywhere else when set up on tos to do just that. any help appreciated
 
In short, the TTM_Scalper is an extremely lagging/ super repainter. Adding alerts to it or trying to scan is useless.
 
Last edited by a moderator:
TTM scalper signals are delayed by a few bars. I think that is the culprit.

In short, the TTM_Scalper is an extremely lagging/repainting indicator. Adding alerts to it is useless.
I understand that it is lagging, and cant ask for anything that predicts the furure. Id be rich if i could do that :) i only want to be notified on my phone when the arrow is painted. So far, myself and 4 TOS support guys have not accomplished this. I cant follow the chart all day, and if i am alerted on my phone or watch, i can then take a look and decide wheather or not to take action. this is all on the 1 and 4 hr chart. I so hope someone can tell me correct parameters to use
 
How can I use this in a scan

input n = 8;
input ShowLines = yes;
input SoundAlerts = yes;

def h = high;
def l = low;
def Firstbar = BarNumber();
def Highest = fold i = 1
to n + 1
with p = 1
while p
do h > GetValue(h, -i);
def A = if (Firstbar > n
and h == Highest(h, n)
and Highest)
then h
else Double.NaN;
def Lowest = fold j = 1
to n + 1
with q = 1
while q
do l < GetValue(l, -j);
def B = if (Firstbar > n
and l == Lowest(l, n)
and Lowest)
then l
else Double.NaN;
rec Al = if !IsNaN(A)
then A
else Al[1];
rec Bl = if !IsNaN(B)
then B
else Bl[1];

plot ph = Round(A, 2);
ph.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot hL = if Al > 0
then Al
else Double.NaN;
hL.SetHiding(!ShowLines);
hL.SetPaintingStrategy(PaintingStrategy.DASHES);
hL.SetDefaultColor(Color.cyan);

plot pl = Round(B, 2);
pl.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot ll = if Bl > 0
then Bl
else Double.NaN;
ll.SetHiding(!ShowLines);
ll.SetPaintingStrategy(PaintingStrategy.DASHES);
ll.SetDefaultColor(Color.RED);
 
Last edited by a moderator:
I am using the TTM Scalper Alert on my charts along with the 21 EMA and 2 sets of Keltner Channels.
Is it possible to be alerted when a TTM Scalper Alert Arrow prints up or down. Not knowing anything about programming it seems that if this could be possible through a scan on the Daily time frame in my meager paper testing it has some potential good buy and sell signals.
Thank you to anyone who may be able to help.
Richard Lamkin
 
This indicator is a super repainter / super lagger
The signals do not happen in real time.

Scans and alerts do work in real time.
So this indicator can not be used in alerts or scans.
Read through this thread to understand the host of other issues related to this study.

@QUIKTDR1 @Richard Lamkin
 
Last edited:
Unfortunately my coding experience is pretty limited so I can't help in that respect. As a caveat though please beware that the TTM does need a certain amount of candles to confirm a signal so it is a repainter. @MerryDay may be able to shed further light on your issue.
 
Very nice - thank you for your time and effort. A scan version would be of significant value to the TS community, but somewhat more challenging I suspect.

The TOS Scan function does a "too complex" choke after uncommenting the scan line and even after paring the code down to bare bones.
Unfortunately my coding experience is pretty limited so I can't help in that respect. As a caveat though please beware that the TTM does need a certain amount of candles to confirm a signal so it is a repainter. @MerryDay may be able to shed further light on your issue.

Given that this indicator is significantly laggy and is a prolific repainter.
Neither alerts nor scans serve any value.
Read through the whole thread for a discussion of the myriad of issues with this indicator.
 
Last edited:

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