• Get $40 off VIP by signing up for a free account! Sign Up

Modify $Tick Indicator to other tickers

Likos

Member
2019 Donor
This indicator is used for a sub-chart. However, when I tried to modify it to be used on other tickers it wouldn't work, only fixated to work on "TICK". I'm rather curious to do some testing on this thing. As always, your replies and help are greatly appreciated.

Code is followed as this:

Code:
declare lower;

def MyDay;
MyDay = GetDay();
def NewDay;
NewDay = if MyDay[0] == MyDay[1] then 0 else 1;

def AccumTick;
def MyTick = close("$TICK", priceType = PriceType.LAST);
AccumTick = if NewDay == 1 then MyTick else AccumTick[1] + MyTick;

plot Diff;
Diff = AccumTick;
plot ZeroLine = 0;


Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff < Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));
ZeroLine.SetDefaultColor(CreateColor(160, 160, 160));
 
Last edited by a moderator:
Solution
Curious & for testing.

So there's no way?
@BenTen is correct. There is no statistical relevance to using the cumulative tick indicator with anything except $Tick.

But, feel free to stick in anything you want. Here is an example, replacing $Tick with SPY
Ruby:
declare lower;

def MyDay;
MyDay = GetDay();
def NewDay;
NewDay = if MyDay[0] == MyDay[1] then 0 else 1;

def AccumTick;
def MyTick = close("SPY", priceType = PriceType.LAST);
AccumTick = if NewDay == 1 then MyTick else AccumTick[1] + MyTick;

plot Diff;
Diff = AccumTick;
plot ZeroLine = 0;


Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN)...
That's the Cumulative Tick indicator. Why would you want to modify it to work with individual tickers? It wouldn't make sense, and it wouldn't work.
 
Curious & for testing.

So there's no way?
@BenTen is correct. There is no statistical relevance to using the cumulative tick indicator with anything except $Tick.

But, feel free to stick in anything you want. Here is an example, replacing $Tick with SPY
Ruby:
declare lower;

def MyDay;
MyDay = GetDay();
def NewDay;
NewDay = if MyDay[0] == MyDay[1] then 0 else 1;

def AccumTick;
def MyTick = close("SPY", priceType = PriceType.LAST);
AccumTick = if NewDay == 1 then MyTick else AccumTick[1] + MyTick;

plot Diff;
Diff = AccumTick;
plot ZeroLine = 0;


Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff < Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));
ZeroLine.SetDefaultColor(CreateColor(160, 160, 160));

YHNYGhU.png
 
Solution
@BenTen is correct. There is no statistical relevance to using the cumulative tick indicator with anything except $Tick.

But, feel free to stick in anything you want. Here is an example, replacing $Tick with SPY
Ruby:
declare lower;

def MyDay;
MyDay = GetDay();
def NewDay;
NewDay = if MyDay[0] == MyDay[1] then 0 else 1;

def AccumTick;
def MyTick = close("SPY", priceType = PriceType.LAST);
AccumTick = if NewDay == 1 then MyTick else AccumTick[1] + MyTick;

plot Diff;
Diff = AccumTick;
plot ZeroLine = 0;


Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff < Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));
ZeroLine.SetDefaultColor(CreateColor(160, 160, 160));

YHNYGhU.png

Damn. In the archives would there happen to be a script that comes close to this one?
 
Damn. In the archives would there happen to be a script that comes close to this one?

Come close to what? What are you trying to do?
So far, it has only been determined what you do not want.

If you are building a house, you would be required to provide blueprints and detailed specifications.
If you are asking to build custom code, please provide an annotated chart image and detailed specifications.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thread starter Similar threads Forum Replies Date
S Modify Horizontal Price Line Questions 1
S Modify script to work on mobile Questions 0
LLP Modify DMI Breakout Questions 3
Eyl POC modify Questions 2
M Modify Script so as to not display the inputs Questions 6

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
259 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