SecondsFromMidnight() Function

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

Thank you for the answer. I was trying to get help writing thinkScript code using Chat GPT Gemini, and it kept saying that this command exists. Short answer: Chat GPT Gemini doesn't do very well at writing thinkScript code.
 
Thank you for the answer. I was trying to get help writing thinkScript code using Chat GPT Gemini, and it kept saying that this command exists. Short answer: Chat GPT Gemini doesn't do very well at writing thinkScript code.
yup, AI doesn't know thinkscript. it confuses in pinescript and others..
thinkscript is simple enough , just put a few weeks on it and it will start clicking. look at many different functions in the online manual and try the examples. then change it and see what happens. i did this 100s of times. i am a horribly slow learner and i got it figured out.
 
Hello, I'm trying to build a script with the following functionality:

1) For the past 3 years on the SPX (SP500)
2) Look at the trading price for each day, find the High and Low price between 9:30 am (Open) and 11:30 am.
3) Determine the trading price at 11:30 am, and then make two price points, one that is $40 above that price point (call it the +40 point), and one that is $40 below that price point (call it the -40 point). 4) For that same trading day between 11:30 am and 4:00 pm, , determine if the SPX price exceeded the +40 point or the -40 point.
5) Count the number of days that the condition in step 4 occurred.
6) Determine the percentage of days out of the past 3 years that the condition in step 4 occurred.

Presumably, this script would be a Study in TOS. I'm fairly new at writing thinkScript code, but I do have experience at programming (not Python or anything recent). I've been trying to get help from Chat GPT Gemini with this effort, but the code provided by Chat GPT Gemini has been problematic. I have a attached a file with various code snippets from Chat GPT Gemini.

I have been looking for similar scripts on usethinkscript.com, but I cannot find them. If someone could point me to some similar scripts, then I might be able to piece together the thinkScript code. We would be appreciative for any help or comments.

Thank you.
 

Attachments

  • thinkScript code - percent of trading days outside 18 bar opening.docx
    39.8 KB · Views: 24
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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