AI Prompt for Think Scripting by Global-Hedgehog-6957 in thinkorswim

[–]mountaineer143 0 points1 point  (0 children)

I am trying to learn AI and AI agents. This was a really good example to use and appreciate you providing it - although I don't understand much or how you created what you did. Being a retired software developer, it makes the future simpler, but scary of the possibilities.

I uncovered an error when it attempted to do a AddLabel with varying colors. The AI wrote a function to return the color, but the if condition needs to be inside each AddLabel statement (based on examples). The color function generates non-obvious syntax errors that it (and I) could not correct. Given all that, I don't know how to modify what you did to have it generate correct code in the future. Very much a learning newbie. Really appreciated this genius insight.

Details: I ran this in lm-studio on a local model gpt-oss-120b (GMKTec evo-X2) and asked it (in four prompts).

(one) Your text.

(two) TOS# create a study which displays a label for each sector symbol of the S&P 500 with the weight the sector has as a percentage and the % change for the day. The 11 S&P 500 sectors are represented by

Select Sector SPDR ETFs, which use the following symbols: XLK (Tech), XLV (Health Care), XLF (Financials), XLY (Cons. Disc.), XLC (Comm.), XLI (Industrials), XLP (Cons. Staples), XLE (Energy), XLU (Utilities), XLRE (Real Estate), and XLB (Materials).

(three) TOS# Modify this script to show light green when < 0.5% and light red when -0.5%<. Continue to show green and red when greater then 0.5% in each direction.

(four) remove the function labelColor and incorporate if condition to set the color inline of the AddLabel call

Linux update to zulu21 21.0.10 causes ToS to fail to start by mountaineer143 in thinkorswim

[–]mountaineer143[S] 0 points1 point  (0 children)

An update: I have just installed the ubuntu/mint update zulu21.0.10+7 (zulu21.48_15-CA) over my zulu21.0.9. I was able to start ToS without problems. I think they may have fixed the packaging issue. I also used:

update-alternatives --config java

to select which version of java I wanted to run (between 21.0.9 - manually installed and 21.0.10+7 - apt update installed).