Onchain Edge Profile picture
May 4 20 tweets 7 min read Twitter logo Read on Twitter
Backtesting Onchain Metrics in 5 Minutes? Absolutely.

See How @glassnode and GPT-4 Can Help You Achieve It in 5 Steps.

👇 #btc #eth #onchain #chatgpt
Here is the chat gpt 4 prompt I used:

"I want you to be a data analyst and create a sma backtesting strategy and calculate the Sharpe ratio of BTC. BTC = m1, and each formula needs to follow the following format: f1,f2,f3... Here is the glassnode syntax:" Image
Since #chatgpt 4 isn't familiar with the newest glassnode syntax, you will need to copy and paste it from this google sheets file:

@glassnode Workbench Syntax

docs.google.com/spreadsheets/d…
I wasn't that happy with the initial request, so I asked chat gpt to output a crossover strategy with two simple moving averages.

Prompt: "Can you do the same but make the strategy with two sma."
Chat Gpt 4 output:

We can create a backtesting strategy using two SMAs, often called a Moving Average Crossover strategy. In this example, we will use a short-term (20-day) and a long-term (50-day) SMA. Image
Great!

Now let's add the formulas to @glassnode

f1 = sma(m1, 20)
f2 = sma(m1, 50)
f3 = if(f1, ">", f2, 1, -1)
f4 = backtest(m1, f3, "2020-01-01", 10000, 0.001)
f5 = sharpe_ratio(f4, 50) Image
Go to @glassnode workbench and click on + Add to add a formula.

If you don't have a glassnode account, you can support me by using my link:
studio.glassnode.com/partner/oe Image
Copy and paste the formula into the input field, then click "Evaluate and draw".

Do that with the remaining formulas. Image
I also recommend asking chat gpt 4 questions on the different formulas. That will improve your comprehension.

Let's say I want to understand what:

f3 = if(f1, ">", f2, 1, -1)

does
So I ask: "What does formula f3 do"

I get this answer:

`f3` generates a trading signal for the moving average crossover strategy by comparing the 20-day and 50-day SMAs. Image
When you have added all the formulas, it should look like this: ImageImage
But is this backtesting strategy actually any good?

A trading strategy is useless if you don't know it's better than a simple "buy-and-hold" strategy.
So I asked: "how can I check if my backtest was more profitable than just holding btc" Image
The first chat gpt 4 output wasn't that great so I need to regenerate a few times.

I had to do a bit of troubleshooting.

The syntax that chat gpt 4 spits out isn't always correct.
Here are the formulas you need to add:

f6 = value_at(m1, "2020-01-01")
f7 = m1-1
f8 = (f7 / f6) * 10000
f9 = f4-1 - f8 Image
Results:

The backtested strategy value: $15'642 💀
Buy-and-hold strategy value: $40'288 🔥

Profitability (f9): -24k
Conclusion: The strategy was not more profitable than a simple "buy-and-hold" strategy. Image
This shows us how important it is to backtest strategies to know if they're profitable.
I will backtest many onchain strategies in the next few weeks and share the profitability scores.

Let's find the most profitable and successful backtesting strategy.

Caveat: There is a risk of overfitting the strategy to the past data. I need to keep that in mind.
I hope you've found this thread helpful.

Follow me @onchain_edge for more.

Like/Retweet the first tweet below if you can:
I appreciate the support! ❤️

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Onchain Edge

Onchain Edge Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @onchain_edge

Feb 12
The biggest mistake new crypto investors make:

Missing early tell-tale signs of a coin breaking out."

This mistake can cost you a lot of money, and opportunity costs.

That's why you need this free tool.
🔻
Let me introduce

The Orion terminal

data.orionterminal.io/screener

At first glance, it looks rather complicated, but amongst all data lies precious data points to help you catch breakouts.
Interested in in-depth weekly reports with stuff I don't share on Twitter?

Fill out this form so that you don't miss the OE premium launch:
forms.gle/NY3xnnF168bWyo…
Read 22 tweets
Feb 11
On-chain Indicator Insights:

Examining the Recent $BTC Price Action

What can we expect?
🔻
If you missed the previous onchain indicator insights, here it is:
$BTC got rejected at $23.8k

The next Major support is at $20.8k Image
Read 13 tweets
Feb 2
Catch $BTC breakouts by combining onchain data and tradingview indicators.

This is how you use @cryptoquant_com pro charts effectively!
👇
1/18 First, start by creating an account on @cryptoquant

cryptoquant.com

You will need an advanced account to create your charts.
2/18 Then head over to "Pro Chart" to start analyzing onchain data.
Read 19 tweets
Feb 1
$BTC monthly close was below $23.3k

$BTC will most likely retest $20.8k and bounce between $20k and $28.9k in February.
The bullish part:
There's a huge gap with no major resistances leading up to $28.9k Image
There is also a monthly buy signal on the VMC indicator.

In 2019 $BTC rallied from $5k to $13k in the next two months. Image
Read 5 tweets
Jan 29
On-chain Indicator Insights:

Examining the Recent $BTC Price Action

👇
The monthly $BTC candle close is just around the corner.

A monthly close above $23.3k would be a rather bullish mid-term signal.
$BTC Short-term Resistance & Support:

➡️ Resistance is at $25k
➡️ Support is at $20.9k

Blue liquidity area is a good buying range. To be used in combination with the on-chain metrics below.
Read 10 tweets
Jan 9
Did you know about Samuel Benner,

a farmer who predicted 100+ years of nearly perfect market moves?

Here is how you can use the Benner Cycle for your investments and why 2023 will be a great year to accumulate.
👇
1/9 He published a book in 1875 predicting business and commodity prices, including "panic years," "good times," and "hard times."
2/9 In panic years, Benner observed market behavior that led to irrational buying or selling, causing stock prices to skyrocket or plummet.
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(