A guide to functions available in the Workbench product on Glassnode.
Workbench is a powerful tool in Glassnode Studio enabling analysts to compare, assess and create a variety of metrics available on the platform.
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.
float value e.g.
Draws a horizontal line at the specified y-ordinate.
Simple Moving Average
Returns a simple moving average of dataset m1 with a period length specified.
Exponential Moving Average
Returns an exponential moving average of dataset m1 with a period length specified.
Returns a moving median of dataset m1 with a period length specified.
Returns a rolling sum of dataset m1 with a period length specified.
Returns a standard deviation of dataset m1 with a period length specified.
Calculates an expanding sum using all data from time since up to each datapoint. (See Note 1)
Calculates an expanding mean using all data from time since up to each datapoint. (See Note 1)
Cumulative Standard Deviation
Calculates an expanding standard deviation using all data from time since up to each datapoint. (See Note 1)
Returns a cumulative maximum of dataset m1 with a period length specified.
Percent Change Over Period
Returns the percentage change of m1 over the specified period. Values are returned as decimal (i.e. 0.20 indicates +20% growth over the specified 'period'). Note that
Difference Over Period
Returns the absolute value change of m1 over the specified period. Calculated as the difference between each datapoint and data from the specified 'period' in the past.
Returns the absolute value of all data in m1.
Raises all data in m1 to the specified power 'n'.
Takes the logarithm (base 10) of all data in m1.
Relative Strength Index
Calculates the relative strength index for m1 using the specified input 'period'.
Draws a line from y=0 to y=n, increasing in increments of 1 (where n is the number of datapoints in m1).
Range (defined start/end)
Draws a line from y=start to y=end, changing in increments of (end-start)/n (where n is the number of datapoints in m1).
Returns the minimum value of all data in a dataset (or n).
Returns the maximum value of all data in a dataset (or n).
Shifts the dataset right (positive) or left (negative) by the number of timesteps in the defined period. For 1hr resolution data, a period of -24 will shift the data left by 24hrs, where as for 1d resolution data, it would shift it left by 24-days.
Establishes an if-then condition comparing the trace of m1 to m2 at each data point, returning the result
Calculates the Pearson's correlation factor between traces
Returns the value at a specific date as a horizontal line.
Returns a subset slice of
Returns the highest value from all input traces at each x-ordinate.
Returns the lowest value from all input traces at each x-ordinate.
Returns the relative drawdown from the all-time high of
Returns the annualized rolling mean return of
Returns the annualized realized volatility of
Returns the annualized Sharpe ratio of
Returns the net asset value (NAV) curve of a trading strategy defined by the trading signal
Dollar Cost Averaging
Returns the net asset value (NAV) curve of the aggregated position in asset
Dollar Cost Averaging Installments
A helper function that simulates daily DCA (dollar cost averaging) installments. The parameters are: a price series
- 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.