Onchain Edge Profile picture
May 4, 2023 β€’ 20 tweets β€’ 7 min read β€’ Read on X
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

May 14
Less than 10 hours since OpenAI announced GPT-4o and the hype is unreal.

Here are 3 wild crypto examples you don't want to miss:

1. Technical analysis based on a screenshot of a chart... Image
1. Copy a chart. With or without indicators

Use a simple prompt: "Hi Chat gpt, please do some technical analysis on $banana"

The answer will blow you away🀯
2. Want to do some data analysis on the fly?

Screenshot > table > analysis of the data ($BTC quarterly returns)
Read 7 tweets
Oct 11, 2023
The Best Alpha Tools & Resources in Crypto.

[THREAD] πŸ‘‡
1. Since 2017, I've been deep in crypto.

Today?

I am sharing a list of 18 tools and resources I use daily to find alpha for research purposes.
2. (free)

Everyone probably already knows coingecko, but I want to start this thread beginner-friendly.

β†’ View 1000s of cryptocurrency prices
β†’ Easily track which narrative is picking up by going to the categories section. coingecko.com/en/categories
Image
Read 26 tweets
Oct 9, 2023
I've spent over 4380+ hours looking at charts.

Here are the 12 Best Crypto Charting Websites I found.

Let's take a look.
🧡
1/15 (free/paid)

+ the number one charting platform for crypto, stocks, and forex
+ great community with many trade ideas and tutorials
+ extensive list of free and paid indicators.
+ A free account is enough for beginners

The best place to start! tradingview.com
2/15 (free)

@coinglass_com data with the tradingview interface. There is a lot more exchange data available than on tradingview.

+ liquidations
+ cumulative volume delta
+ open interest

This information is extremely useful for traders. tv.coinglass.com/Binance_BTCUSDT
Read 16 tweets
May 19, 2023
BRC-20 hype is breaking BTC

This is what you need to know about the fastest-growing trend on the #bitcoin network πŸ‘€

πŸ”½
1. We're witnessing a seismic shift in the Bitcoin landscape as the demand for block space skyrockets,

all thanks to the surging interest in BRC-20 tokens! Image
2. You can check what is trending on the ordinals wallet

ordinalswallet.com/brc20
Read 20 tweets
May 13, 2023
Are you tired of losing track of your crypto trades?

Learn how ChatGPT-4 and DeBank can streamline your tracking, making your life easier and trading more effective.

This is the process and prompt I use πŸ”½ #eth
Step 1: Go to chat GPT-4 and make sure you select version 4 Image
Copy and paste the following prompt into Chat GPT-4

And wait before sending it.

oceandeck.notion.site/GPT-Debank-Pro…
Read 12 tweets
Feb 12, 2023
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

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!

:(