Earlier than we head to the seaside for a swim, we have to assess the climate.
Earlier than we take a commerce, we have to decide the market circumstances.
Contents
For the needs of this instance, we are going to preserve issues easy and say that market circumstances are good if these three circumstances are met:
If the worth is above its 20-period easy shifting common
If RSI is between 55 and 80
If VIX is beneath 25
The asset is bullish if the worth is above its shifting common.
Usually, when this occurs, the slope of the shifting common can be sloping upwards.
So to maintain issues easy, we aren’t going to verify the slope.
An RSI above 55 signifies robust upside momentum.
However we don’t need to purchase when it’s overbought (as indicated by RSI above 80).
Underneath regular circumstances, VIX is usually 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.”
Notice that I mentioned “20-period easy shifting common” as an alternative of “20-day easy shifting common” as a result of I wished this indicator to work for different timeframes apart from 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 circumstances are good.
(I’ll present you the image later.)
However first I need to “Save script”…
And I gave it the identify “Market circumstances”.
Entry The Prime 5 Instruments For Possibility Merchants
Now I can activate this practice indicator anytime I need through the Indicators panel…
Right here is the way it appears in 2025, utilizing the day by day chart of SPY…
I additionally added the blue 20-period easy shifting common to verify that the inexperienced background seems solely when the worth is above it.
It seems to work fairly effectively.
We see the worth going up when the market circumstances are good, as indicated by the inexperienced background.
For the 12 months 2022, it appears fairly totally different, with a lot much less inexperienced…
The RSI didn’t usually keep above 55, so we don’t see a lot inexperienced background.
On the whole, it was a bearish 12 months.
Merchants and traders can revenue by collaborating out there when instances are good and staying out of it when circumstances are dangerous.
This easy customized indicator, constructed with ChatGPT’s assist, may help us do that.
You possibly can attempt prompting ChatGPT to indicate inexperienced market circumstances 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 circumstances.
You probably have any questions, please ship an e-mail or go away a remark beneath.
Commerce protected!
Disclaimer: The data above is for instructional functions solely and shouldn’t be handled as funding recommendation. The technique offered wouldn’t be appropriate for traders who will not be accustomed to alternate traded choices. Any readers on this technique ought to do their very own analysis and search recommendation from a licensed monetary adviser.
