NexusFi: Find Your Edge


Home Menu

 





Be Notified of Multiple Timeframe TTM_Squeezes


Discussion in ThinkOrSwim

Updated
    1. trending_up 3,201 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 3 attachments




 
Search this Thread

Be Notified of Multiple Timeframe TTM_Squeezes

  #1 (permalink)
TomM8888
Chicago IL / USA
 
Posts: 1 since Mar 2018
Thanks Given: 0
Thanks Received: 0

Hi - I want to be notified when a ticker has more than one TTM_Squeeze
in play. For e.g. if I am in a 2 minute chart and the stock symbol
has a squeeze in the daily chart, I want TOS to tell me that
a squeeze also exists in the daily chart by some kind of message on
the 2 minute chart.

I know that I can do a TOS scan and do a multiple timeframe query
for TTM_Squeezes, but I wanted to mirror this functionality in
thinkscript.

Following (in the attachments) are some screenshots of what progress I have so far:

I used the ticker symbol OLLI, but any ticker symbol could be used with
a daily squeeze.

Note that the 2 minute OLLI chart does not have a squeeze, but the daily one does
(i.e. red dots in the zero line).
I was trying to show a label in red when the daily had a squeeze. But it shows
green signifying that there is no squeeze. If I switch to the daily chart, the label does turn red.
So, it looks like my thinkscript is
detecting a squeeze only when the chart I'm displaying has a squeeze.

Does anybody have any ideas?



The script contents of TM_Identity_Multiple_Timeframe_Squeezes is this:
+++++++++++++++++++++++++++++++++++++++++++++
DefineGlobalColor("green", Color.GREEN);
DefineGlobalColor("red", Color.RED);

plot DailyClose = close(period = "Day"); # plot daily closing price

def DaySqz = if (DailyClose.TTM_Squeeze().SqueezeAlert == 0)
then 1 else 0; # Test whether DailyClose has a squeeze

AddLabel(yes, DaySqz, GlobalColor("green")); # display boolean value

AddLabel(yes, "Day", if DaySqz
then GlobalColor("red") else GlobalColor("green" )); # display label red if dailyclose has squeeze
++++++++++++++++++++++++++++++++++++++++++++++

--TomM8888

Attached Thumbnails
Click image for larger version

Name:	OLLI_2min_chart.gif
Views:	449
Size:	74.8 KB
ID:	248498   Click image for larger version

Name:	OLLI_daily_chart.gif
Views:	365
Size:	91.6 KB
ID:	248499   Click image for larger version

Name:	Studies_On_this_chart.gif
Views:	295
Size:	48.2 KB
ID:	248500  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didnt know anythin …
Psychology and Money Management
MC PL editor upgrade
MultiCharts
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
Sammyp800
New York
 
Posts: 1 since Apr 2014
Thanks Given: 1
Thanks Received: 0

Hi Tom. Where you ever able to figure out how to the the label on multiple timeframes for TTM_Squeeze?
I have been trying for a while also. Not able to do it.
so far I got this


def sqz = !TTM_Squeeze().SqueezeAlert;
def direction = TTM_Squeeze()>TTM_Squeeze()[1];
def count = if sqz and !sqz[1] then 1 else count[1]+1;
def fired = if !sqz and sqz[1] then 1 else 0;
def firedCount = if fired then 1 else firedCount[1]+1;
def firedDirection = if fired then direction else firedDirection[1];
addLabel(yes, if sqz then “Squeeze:” + count else if sum(fired,5) then “Fired:” + firedCOunt + if firedDirection then ” Long” else ” Short” else “-”, if sqz then color.red else if sum(fired,5) and firedDirection then color.green else color.orange);


or I this one

def ttm_Squeeze = (TTM_Squeeze().SqueezeAlert == 0);
AddLabel(yes, concat("x=", ttm_Squeeze), color.RED);

Hopefully you get this message.

Reply With Quote




Last Updated on May 6, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts