ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Workbench FunctionSyntaxFunction Description
2
Horizontal Linefloat value e.g. 10.55Draws a horizontal line at the specified y-ordinate.
3
Simple Moving Averagesma(m1,period)Returns a simple moving average of dataset m1 with a period length specified.
4
Exponential Moving Averageema(m1,period)Returns an exponential moving average of dataset m1 with a period length specified.
5
Moving Medianmedian(m1,period)Returns a moving median of dataset m1 with a period length specified.
6
Rolling Sumsum(m1,period)Returns a rolling sum of dataset m1 with a period length specified.
7
Standard Deviationstd(m1,period)Returns a standard deviation of dataset m1 with a period length specified.
8
Cumulative Sumcumsum(m1) or cumsum(m1,since)Calculates an expanding sum using all data from time since up to each datapoint. (See Note 1)
9
Cumulative Meancummean(m1) or cummean(m1,since)Calculates an expanding mean using all data from time since up to each datapoint. (See Note 1)
10
Cumulative Standard Deviationcumstd(m1) or cumstd(m1,since)
Calculates an expanding standard deviation using all data from time since up to each datapoint. (See Note 1)
11
Cumulative Maxcummax(m1) or cummax(m1, period)Returns a cumulative maximum of dataset m1 with a period length specified.
12
Percent Change Over Periodpercent_change(m1,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').
13
Difference Over Perioddiff(m1,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.
14
Absolute Valueabs(m1)Returns the absolute value of all data in m1.
15
Powerpow(m1,n)Raises all data in m1 to the specified power 'n'.
16
Logarithmlog(m1)Takes the logarithm (base 10) of all data in m1.
17
Relative Strength Indexrsi(m1,period)Calculates the relative strength index for m1 using the specified input 'period'.
18
Rangerange(m1)Draws a line from y=0 to y=n, increasing in increments of 1 (where n is the number of datapoints in m1).
19
Range (defined start/end)range(m1,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).
20
Minimummin(m1, m2, ..., n)Returns the minimum value of all data in a dataset (or n).
21
Maximummax(m1, m2, ..., n)Returns the maximum value of all data in a dataset (or n).
22
Shiftshift(m1, period)Shifts the dataset right (positive) or left (negative) by the number of timesteps in the defined period.
23
If-Then Conditionif(m1, "cond", m2, true, false)
Establishes an if-then condition comparing the trace of m1 to m2 at each data point, returning the result true or false.
24
Pearson's Correlationcorr(m1, m2, period)
Calculates the Pearson's correlation factor between traces m1 and m2 over a defined trailing period. The correlation will be run at the resolution of the largest input trace resolution.
25
Value Atvalue_at(m1, date)Returns the value at a specific date as a horizontal line.
26
Subsetsubset(m1, since?, end?)Returns a subset slice of m1 between timestamp since and end.
27
Roundround(m1, digits, mode?)
Rounds m1 to a specified number of significant figures (digits). There are three rounding modes available; nearest mode=0 (default), rounddown mode=-1, and roundup mode=1.
28
Upperupper(m1, m2, ...)Returns the highest value from all input traces at each x-ordinate.
29
Lowerlower(m1, m2, ...)Returns the lowest value from all input traces at each x-ordinate.
30
Drawdowndrawdown(m1)Returns the relative drawdown from the all-time high of m1.
31
Mean Returnmean_return(m1, period)Returns the annualized rolling mean return of m1 over period.
32
Realized Volatilityrealized_vol(m1, period)Returns the annualized realized volatility of m1 over period.
33
Sharpe Ratiosharpe_ratio(m1, period)Returns the annualized Sharpe ratio of m1 over period.
34
Backtest
backtest(m1, f1, since, initial_capital_usd, rel_trading_costs)
Returns the net asset value (NAV) curve of a trading strategy defined by the trading signal f1 on asset price series m1 with an inital capital of initial_capital_usd from since to present. Relative trading costs are given by rel_trading_costs.
35
Dollar Cost Averagingdca(m1, f1, since)
Returns the net asset value (NAV) curve of the aggregated position in asset m1. f1 defines the daily DCA installments over time and since defines the starting timestamp of DCA. The function calculates cumsum(f1/m1, since)*m1.
36
Dollar Cost Averaging Installments
dca_installments(m1, since, total_invest_usd, numb_installments)
A helper function that simulates daily DCA (dollar cost averaging) installments. The parameters are: a price series m1, a timestamp when DCA begins: since, the total target investment in USD: total_invest_usd, how many installments in total: numb_installments. The function returns a step function visualizing the daily installments (in USD). This serves as possible input f1 to the dca function.
37
Backtest
backtest(m1, f1, since, initial_capital_usd, rel_trading_costs)
Models trading strategies and portfolio performance for a given initial capital size. The backtest function returns the NAV of a portfolio invested in a specified asset, with the defined parameters.
38
Price Seriesm1The price series (e.g., BTC) you want to trade.
39
Trading Signalf1The trading signal representing a gearing ratio applied to the percent change performance of price m1.
40
Start DatesinceA timestamp indicating the start date of your trading simulation (e.g., "2020-01-01").
41
Initial Capital (USD)initial_capital_usd
USD denominated capital allocated to the strategy. No additional capital flows in or out of the simulated trading portfolio.
42
Relative Trading Costsrel_trading_costs
An approximation of the expected relative trading costs, which consist of exchange fees and slippage. A value of, e.g., 0.001 refers to trading costs of 0.1% of the volume of each trade.
43
Cumulative Standard Deviationcumstd(m1) or cumstd(m1, since)Calculates an expanding standard deviation using all data from time since up to each data point.
44
Cumulative Sumcumsum(m1) or cumsum(m1, since)Calculates an expanding sum using all data from time since up to each data point.
45
Standard Deviationstd(m1, period)Returns a standard deviation of dataset m1 with a period length specified.
46
Percent Change Over Periodpercent_change(m1, 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 percent_change replaced the original returns function.
47
Difference Over Perioddiff(m1, period)
Returns the absolute value change of m1 over the specified period. Calculated as the difference between each data point and data from the specified 'period' in the past.
48
Powerpow(m1, n)Raises all data in m1 to the specified power 'n'.
49
Rangerange(m1)Draws a line from y=0 to y=n, increasing in increments of 1 (where n is the number of data points in m1).
50
Relative Strength Indexrsi(m1, period)Calculates the relative strength index for m1 using the specified input 'period'.
51
If-Then Conditionif(m1, "cond", m2, true, false)
Establishes an if-then condition comparing the trace of m1 to m2 at each data point, returning the result true or false. This tool can accept nested functions in place of the inputs m1, m2, true, and false.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100