Comment on page
A guide to functions available in the Workbench product on Glassnode.
The table below provides a guide to the use of various workbench functions available to analyse datasets.
m1, m2etc. refer to a particular dataset added to the chart.
nis a float value.
periodis an integer value defining the number of trailing data-points considered by the function, applied to the data resolution specified (i.e. a simple moving average with period 30 will consider 30-days for daily resolution data, and 30-weeks for weekly resolution data).
sinceis a timestamp in format
"YYYY-MM-DD HH:mm:ss"(quotations required in syntax). Timestamps can be shortened from left to right, for example
"2010"will resolve from 01-Jan-2010 onwards, and
"2010-06"will resolve from 01-June-2010 onwards.
Functions may be nested, such that any input timeseries (i.e.
m1) may be replaced by a function to be evaluated, for example
When timeseries of different resolutions are compared (i.e. subtracting a metric with resolution 1d from a metric with 1h resolution), workbench will perform the operation at the larger resolution (1d in this case), and use the 00:00 UTC timestamp of the smaller resolution.
periodresolution is defined by the largest resolution of the timeseries being compared.
- 1.Example for cumulative sum/mean/std: the function
cummean(m1,"2012-01-01")at date "2020-01-01" will return a mean of all data from 2012-01-01 to 2020-0-01, but not consider any data after this. These metrics will return zero for all periods prior to defined timestamp "since".
- 2.Example for
backtest: the function
backtest(m1, if(sma(m1, 20), ">", sma(m1, 50), 1, 0), "2020-01-01", 1000, 0.001)simulates the simple moving average cross-over strategy for an investment of $1000 from "2020-01-01" until present. The trading costs are approximated with 0.1% of the volume per trade.
- 3.Example for
dca(m1, f1, "2020-01-01")with
dca_installments(m1, "2020-01-01", 1230, 1000). This simulates the dollar cost averaging of a total investment of $1230 over 1000 days, starting from "2020-01-01".
This workbench tutorial provides an introduction to the tool, and shows you how to build your first metrics and assess Bitcoin market cycles using Supply Last Active 1yr+.Tutorial Workflow:
- Add base metrics and set correct scales and axes.
- Convert a Supply from % into BTC Volume.
- Calculate a new metric ‘Coins Younger than 1yr.
- Calculate a Supply Net Position Change metric using the diff function.
Discover Workbench's new backtesting suite and take your investment strategy to the next level. Test and compare trading hypotheses, and evaluate risk and performance with metrics like drawdown and Sharpe ratio. Explore basic and advanced trading strategy examples, including on-chain indicators.
See backtesting in action through the video guide.