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.