Earlier than the arrival of AI, if we wished to write down a customized indicator in TradingView, we would wish to learn to code PineScript whereas referencing TradingView’s documentation on technical indicator features.

Or you may rent a programmer.

Contents

At the moment, utilizing the free model of ChatGPT, we are able to have AI write the code for us.

Let’s see how.

Open up the Pine Editor in TradingView and begin a brand new indicator:

Suppose we would like an indicator to provide us a purchase sign when the 8-period exponential transferring common (EMA) crosses above the 21-period exponential transferring common, as within the case of Apple (AAPL) on November 21, 2024:

We have now set the 8-ema as blue and the 21-ema as pink.

As well as, we solely need this sign when the inventory is in a longer-term bullish mode, which we’ll outline as when the 50-period easy transferring common is sloping up.

We’re utilizing every day charts for this instance.

So 8-period, 21-period, and 50-period means 8-day, 21-day, and 50-day.

Nonetheless, these will be achieved at any time.

We’re merely going to ask the next query in chatgpt.com

And it spits out a bunch of code on the right-hand panel.

Copy and paste that into the PineEditor in TradingView and click on “Add to Chart”…

It labored,

Free Earnings Season Mastery eBook

It even drew within the 8-ema, 21-ema, and the 50-sma as blue, pink, and inexperienced, respectively.

In case you don’t like these colours, you may open up the Pine Editor, and with rudimentary experimentation with code, you may merely change these colours up:

Or higher but, simply ask ChatGPT to change the code for you.

I’m certain it will likely be joyful to conform.

By the way in which, keep in mind to save lots of your script by clicking that “Save” hyperlink that’s beneath the “Untitled script.”

To proceed with our instance, we requested it so as to add a promote sign by asking it:

“Are you able to add a promote sign when the 8-ema crosses beneath the 21-ema whereas the 50-sma is sloping down?”

It modified the script with the next outcomes:

ChatGPT will not be the panacea for all of your customized charting wants.

No less than Pinescript coders’ jobs won’t be fully changed by AI to date.

In case you ask the free ChatGPT model to do an excessive amount of, it’ll reply by saying:

In our instance, now we have given it a comparatively simple job.

In case your request is extra difficult, ChatGPT might have errors within the code, so while you attempt to run it in TradingView, it won’t run and gives you an error message.

You’ll be able to copy and paste the error message again to ChatGPT, and the code will probably be rewritten.

It’s possible you’ll ultimately arrive at a workable script by means of such an iterative course of that’s typical of the coding course of.

It’s at all times good to double-check manually throughout a number of ticker symbols and perhaps timeframes to validate that the purchase/promote sign generated is what you supposed.

We hope you loved this text on.

You probably have any questions, please ship an e-mail or depart a remark beneath.

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 buyers who aren’t aware of change traded choices. Any readers on this technique ought to do their very own analysis and search recommendation from a licensed monetary adviser.

Source link

Leave A Reply

Company

Bitcoin (BTC)

$ 88,178.00

Ethereum (ETH)

$ 2,075.97

BNB (BNB)

$ 631.76

Solana (SOL)

$ 145.43
Exit mobile version