Earlier than we head to the seashore for a swim, we have to assess the climate.
Earlier than we take a commerce, we have to decide the market situations.
Contents
For the needs of this instance, we are going to maintain issues easy and say that market situations are good if these three situations are met:
If the worth is above its 20-period easy shifting common
If RSI is between 55 and 80
If VIX is under 25
The asset is bullish if the worth is above its shifting common.
Typically, when this occurs, the slope of the shifting common can also be sloping upwards.
So to maintain issues easy, we aren’t going to test the slope.
An RSI above 55 signifies robust upside momentum.
However we don’t wish to purchase when it’s overbought (as indicated by RSI above 80).
Below regular situations, VIX is often below 25.
The above suggests elevated market volatility and market actions.
I prompted ChatGPT with…
“Write PineScript in Tradingview to show a inexperienced background if the 20-period easy shifting common and RSI are between 55 and 80, and the worth is above the 20-period easy shifting common, and VIX is lower than 25.”
Observe that I stated “20-period easy shifting common” as a substitute of “20-day easy shifting common” as a result of I wished this indicator to work for different timeframes moreover the day by day chart.
I additionally didn’t have to specify that it was a 14-period RSI, since TradingView defaults to the 14-period RSI.
ChatGPT generated some code, which I copied and pasted into the Pine Editor panel in TradingView.
I opened the PineEditor in TradingView:

Then chosen Create New Indicator:

After which pasted the 18 strains of code that ChatGPT gave me…

I clicked “Add to Chart,” and the inexperienced background appeared when market situations are good.
(I’ll present you the image later.)
However first I wish to “Save script”…

And I gave it the title “Market situations”.
Entry The High 5 Instruments For Possibility Merchants
Now I can activate this tradition indicator anytime I need through the Indicators panel…

Right here is the way it seems to be in 2025, utilizing the day by day chart of SPY…

I additionally added the blue 20-period easy shifting common to substantiate that the inexperienced background seems solely when the worth is above it.
It seems to work fairly nicely.
We see the worth going up when the market situations are good, as indicated by the inexperienced background.
For the 12 months 2022, it seems to be fairly totally different, with a lot much less inexperienced…

The RSI didn’t typically keep above 55, so we don’t see a lot inexperienced background.
Basically, it was a bearish 12 months.
Merchants and traders can revenue by taking part out there when occasions are good and staying out of it when situations are dangerous.
This straightforward customized indicator, constructed with ChatGPT’s assist, may help us do that.
You’ll be able to strive prompting ChatGPT to indicate inexperienced market situations primarily based by yourself metrics.
Or you possibly can paste the 18 strains of code above into your PineScript editor and check out it out.
By making code edits and experimenting, you would possibly get pretty much as good at writing customized indicators as ChatGPT.
We hope you loved this text a couple of TradingView script that highlights good market situations.
When you have any questions, please ship an electronic mail or go away a remark under.
Commerce protected!
Disclaimer: The data above is for academic functions solely and shouldn’t be handled as funding recommendation. The technique offered wouldn’t be appropriate for traders who will not be aware of alternate traded choices. Any readers on this technique ought to do their very own analysis and search recommendation from a licensed monetary adviser.

