Tick Horizontal PriceLevel update

Solution
It only updates on the close - i had someone write another script that updates on each Tick but i cant figure out how to have it plot the line all the way to the left you have to have a static input value and change it as you change the number of bars on the screen

Code:
def barCount = IF !IsNaN(close) THEN IF IsNaN(barCount[1]) THEN 1 ELSE barCount[1] + 1 ELSE barCount[1];

AddLabel(yes, "BarCount: " + barCount, [URL='http://color.GREEN']color.GREEN[/URL]);

input avgLength = 500;
#input barCount;
def assetPrice = close;
def TMA = MovAvgTriangular(assetPrice, 1, avgLength);
rec horizLine = if IsNaN(TMA) then horizLine[1] else TMA[0];
plot horzLinePlot = if isnan(TMA) then horizLine else double.nan;
horzLinePlot.setpaintingStrategy(paintingStrategy.LINE)...
I use that script on the $TICK chart, and it works just fine. What problem are you having?
It only updates on the close - i had someone write another script that updates on each Tick but i cant figure out how to have it plot the line all the way to the left you have to have a static input value and change it as you change the number of bars on the screen

Code:
def barCount = IF !IsNaN(close) THEN IF IsNaN(barCount[1]) THEN 1 ELSE barCount[1] + 1 ELSE barCount[1];

AddLabel(yes, "BarCount: " + barCount, [URL='http://color.GREEN']color.GREEN[/URL]);

input avgLength = 500;
#input barCount;
def assetPrice = close;
def TMA = MovAvgTriangular(assetPrice, 1, avgLength);
rec horizLine = if IsNaN(TMA) then horizLine[1] else TMA[0];
plot horzLinePlot = if isnan(TMA) then horizLine else double.nan;
horzLinePlot.setpaintingStrategy(paintingStrategy.LINE);
horzLinePlot.setlineWeight(1);
horzLinePlot.setDefaultColor(color.WHITE);
horzLinePlot.hideBubble();
 
It only updates on the close - i had someone write another script that updates on each Tick but i cant figure out how to have it plot the line all the way to the left you have to have a static input value and change it as you change the number of bars on the screen

Code:
def barCount = IF !IsNaN(close) THEN IF IsNaN(barCount[1]) THEN 1 ELSE barCount[1] + 1 ELSE barCount[1];

AddLabel(yes, "BarCount: " + barCount, [URL='http://color.GREEN']color.GREEN[/URL]);

input avgLength = 500;
#input barCount;
def assetPrice = close;
def TMA = MovAvgTriangular(assetPrice, 1, avgLength);
rec horizLine = if IsNaN(TMA) then horizLine[1] else TMA[0];
plot horzLinePlot = if isnan(TMA) then horizLine else double.nan;
horzLinePlot.setpaintingStrategy(paintingStrategy.LINE);
horzLinePlot.setlineWeight(1);
horzLinePlot.setDefaultColor(color.WHITE);
horzLinePlot.hideBubble();

maybe this will work for you?
https://usethinkscript.com/threads/current-price-line-indicator-for-thinkorswim.8793/
 
Solution
That one does what the script i had written does the problem is you have to put in a static input number so it doesnt dynamically go to the left hand side of the page like the original script did. What I am trying to find is a way to have it function where it always goes all the way to the left and updates with each tick close as you change timeframes and tickframes
 

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