Watch List Columns

Thinker

New member
VIP
I'm trying to create a watch list that has columns showing the number of squeezes if one is going on and to show the number of times a symbol has fired if that is the case. If it shows firing, I want it to show whether the symbol has fired long or short. I've created one column that works for a daily chart but am having trouble creating codes to also see a weekly chart, a 3-day chart, a 4-hour chart, a 1-hour chart, a 30-minute chart, and a 15-minute chart.

Can one of you code experts provide separate coding for the other periods than the daily? Here's the code that appears to work for the daily chart:

Code:
declare lower;


def nBB = 2.0;

def Length = 20.0;

def nK_High = 1.0;

def nK_Mid = 1.5;

def nK_Low = 2.0;



def price = close;



def momentum = TTM_Squeeze(price = price, length = length, nk = nk_Mid, nbb = nbb)."Histogram";

plot oscillator = momentum;

def BolKelDelta_Mid = reference BollingerBands("num_dev_up" = nBB, "length" = Length )."upperband" - KeltnerChannels("factor" = nK_Mid, "length" = Length)."Upper_Band";

def BolKelDelta_Low = reference BollingerBands("num_dev_up" = nBB, "length" = Length )."upperband" - KeltnerChannels("factor" = nK_Low, "length" = Length)."Upper_Band";

def BolKelDelta_High = reference BollingerBands("num_dev_up" = nBB, "length" = Length )."upperband" - KeltnerChannels("factor" = nK_High, "length" = Length)."Upper_Band";

oscillator.DefineColor("Up", CreateColor(0, 255, 255));

oscillator.DefineColor("UpDecreasing", CreateColor(0, 0, 255));

oscillator.DefineColor("Down", CreateColor(255, 0, 0));

oscillator.DefineColor("DownDecreasing", CreateColor(255, 255, 0));

oscillator.AssignValueColor(

if oscillator[1] < oscillator then if oscillator[0] >= 0

then oscillator.Color("Up")

else oscillator.Color("DownDecreasing")

else if oscillator >= 0

then oscillator.Color("UpDecreasing")

else oscillator.Color("Down") );

oscillator.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

oscillator.SetLineWeight(5);



plot squeeze = If(IsNaN(close), Double.NaN, 0);

squeeze.DefineColor("NoSqueeze", Color.GREEN);

squeeze.DefineColor("SqueezeLow", Color.black);

squeeze.DefineColor("SqueezeMid", Color.RED);

squeeze.DefineColor("SqueezeHigh", Color.orange);

squeeze.AssignValueColor(if BolKelDelta_High <= 0 then squeeze.Color("SqueezeHigh") else if BolKelDelta_Mid <= 0 then squeeze.Color("SqueezeMid") else if BolKelDelta_Low <= 0 then squeeze.Color("SqueezeLow") else squeeze.color("noSqueeze"));

squeeze.SetPaintingStrategy(PaintingStrategy.POINTS);

squeeze.SetLineWeight(3);
 
Last edited by a moderator:
I'm trying to create a watch list that has columns showing the number of squeezes if one is going on and to show the number of times a symbol has fired if that is the case. If it shows firing, I want it to show whether the symbol has fired long or short. I've created one column that works for a daily chart but am having trouble creating codes to also see a weekly chart, a 3-day chart, a 4-hour chart, a 1-hour chart, a 30-minute chart, and a 15-minute chart.

Can one of you code experts provide separate coding for the other periods than the daily? Here's the code that appears to work for the daily chart:

Code:
declare lower;


def nBB = 2.0;

def Length = 20.0;

def nK_High = 1.0;

def nK_Mid = 1.5;

def nK_Low = 2.0;



def price = close;



def momentum = TTM_Squeeze(price = price, length = length, nk = nk_Mid, nbb = nbb)."Histogram";

plot oscillator = momentum;

def BolKelDelta_Mid = reference BollingerBands("num_dev_up" = nBB, "length" = Length )."upperband" - KeltnerChannels("factor" = nK_Mid, "length" = Length)."Upper_Band";

def BolKelDelta_Low = reference BollingerBands("num_dev_up" = nBB, "length" = Length )."upperband" - KeltnerChannels("factor" = nK_Low, "length" = Length)."Upper_Band";

def BolKelDelta_High = reference BollingerBands("num_dev_up" = nBB, "length" = Length )."upperband" - KeltnerChannels("factor" = nK_High, "length" = Length)."Upper_Band";

oscillator.DefineColor("Up", CreateColor(0, 255, 255));

oscillator.DefineColor("UpDecreasing", CreateColor(0, 0, 255));

oscillator.DefineColor("Down", CreateColor(255, 0, 0));

oscillator.DefineColor("DownDecreasing", CreateColor(255, 255, 0));

oscillator.AssignValueColor(

if oscillator[1] < oscillator then if oscillator[0] >= 0

then oscillator.Color("Up")

else oscillator.Color("DownDecreasing")

else if oscillator >= 0

then oscillator.Color("UpDecreasing")

else oscillator.Color("Down") );

oscillator.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

oscillator.SetLineWeight(5);



plot squeeze = If(IsNaN(close), Double.NaN, 0);

squeeze.DefineColor("NoSqueeze", Color.GREEN);

squeeze.DefineColor("SqueezeLow", Color.black);

squeeze.DefineColor("SqueezeMid", Color.RED);

squeeze.DefineColor("SqueezeHigh", Color.orange);

squeeze.AssignValueColor(if BolKelDelta_High <= 0 then squeeze.Color("SqueezeHigh") else if BolKelDelta_Mid <= 0 then squeeze.Color("SqueezeMid") else if BolKelDelta_Low <= 0 then squeeze.Color("SqueezeLow") else squeeze.color("noSqueeze"));

squeeze.SetPaintingStrategy(PaintingStrategy.POINTS);

squeeze.SetLineWeight(3);

if you want 7 columns, and you have 1 study working, copy the code and paste it 6 times, in new column studies , change the name, and the time frame at the top of the editor window.
 

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