Exhaustive list of functions that cause study to update once per bar?

Glefdar

Active member
I noticed that one of my studies showed different values for the same ticker, and determined it probably was because each chart with that study was loaded up at different times.

I would prefer the study updated with each tick but that doesn't seem to be happening. I think that this must be because some thinkscript functions cause studies to only update once per bar instead of once per tick. Is this right and is there a list of the functions that have this inadvertent consequence?
 
You are correct, and Its the full range functions, like HighestAll.

LuPKxji.png
 
Last edited:

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

You are correct, and Its the full range functions, like HighestAll.

LuPKxji.png

Thanks for your answer! To confirm, it's my understanding that this means (as long as these are the only two "range all" functions the script was using) that if I replace the range functions of "HighestAll" and "LowestAll" with "Highest" and "Lowest" using a length input of the bar count,

(as determined in this sort of manner:
Script BarCount
{Input Condition = close>0;
def Count = If Condition then 0 else Count[1] + 1;}
)
...then the study will update every tick instead of once per bar. That is my understanding of how I'd modify the script to make it update every tick.

EDIT: It seems that using Highest and Lowest with length input of a variable that counts the bars isn't a viable solution because when I make that substitution, I get error "only constants expected" for the "length" parameter. However, in my script, I only had one instance of a function that uses "All" (it was HighestAll) and it seems I can just replace the length with 1000 instead of using the bar count, without any practical consequence for the usability of the indicator.

Aside from that instance of "HighestAll," the only other functions I see that I worry would possibly force updating once per tick are "Min" and "Max". But since these functions just compare to find the greater or lesser of two variables, I can't imagine that they'd force updating once per bar. So I think that in this case, all I had to do to solve the problem was change the instance of "HighestAll" in the script to "High" with a length input of 1000.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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