stocksml.trade
¶
-
EvaluateChoices
(sdf, symbols, dates, choices, baseline=None)[source]¶ Evaluate trading strategy choices
- Parameters
sdf (pandas.DataFrame) – symbol dataframe with price information
symbols (list of str) – list of symbol tickers corresponding to the symbol enum in choices
dates (list of str) – dates corresponding to choices, should match subset of pdf index values
choices (list of tuples) – tuple of (action, symbol enum, limit) for each day. action is an enum of range 0-4 where [buy_limit, buy_sell, hold, sell_limit, sell_buy]. limit is the percent over/under open price (range -1 to 1)
baseline (str) – ticker symbol to use for baseline buy-hold strategy. Default None will not compute a baseline (returns 0)
- Returns
performance of choices and baseline as a fraction of initial cash and ledger log of trades
- Return type
float, float, str