View source: R/backtest_initialize.R
Takes a set of daily prices and daily weights and returns a list of initialized data ready to be traded.
1 2 | backtest_initialize(df_prices, df_weights, use_cash_long, use_cash_short,
name)
|
df_prices |
a data.frame containing the columns: symbol, date, price |
df_weights |
a data.frame containing the columns: symbol, date, w |
use_cash_long |
if TRUE use _CASH_LONG_ price within df_prices, else use 1 for all dates |
use_cash_short |
if TRUE use _CASH_SHORT_ price within df_prices, else use 1 for all dates |
name |
a string name for the backtest results |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.