A list of some likely most useful of my contributions.
One of the most useful tools, provides an overview of pipeline output with min, mean, max, or any series or dataframe. Counts nans. Option to only log when nans are present.
Forward fill of nans within class factors.
A flexible backtest for easy changes with many factors to mix & match. I find this educational.
Fundamental value update frequencies plus a notebook by Doug Baldwin.
Examples for making changes to individual securities
Making optimize weights visible
Normalizing positive and negative values separately, recombining for input to optimize.
Keeps an eye on all-time maximum leverage in the custom chart, watching every minute.
Logging orders, types, fills, cash, order_id's.
Profit-versus-Risk. This tool was more important before optimize which targets leverage. It charts profit based on maximum amount invested and several other things such as maximum intraday leverage, PnL, max short value & several other options.
Logging info just at the end of a backtest in the IDE.
... while remaining under the logging limit
Positions and their PnL for sorting.
Lots of brief useful lines of code.
Close, Open or Crossover (long to short or visa-versa), indicating what an order is up to. Cancel only opening orders for example.
Looks for price jump to close the position.
For taking profit by watching price. Can be reversed for a stop loss.
Slope of a list of values, including as a factor.
Assigning values to a price curve for example. Picture having reached the bottom of a downturn and starting back upward, curving up.
Proportional fitting. For the position of a value within one range, return where it fits within another.
Keeps track of a variable's value, logging new extremes, with a summary at the end.
Makes a waiting period for particular stocks easy.
Beta calculation per stock and an example of automatic targeting of zero-beta. Was more useful before optimize.
Charts overnight margin, the one with costs, as I understand it.
Prefacing logging lines with the minute of the trading day is quicker to read than the timestamps.
Timing to identify slow areas or functions
Elapsed time, run info and logging variables when backtest is done.
def cncl_oos(context, data): # Primarily to prevent the logging of unfilled orders at end of day oo = get_open_orders() # Can also be use at any time to limit partial fills. for s in oo: for o in oo[s]: cancel_order(o.id)
I mostly use the Search portion to quickly search for code in algorithms stored locally. Very powerful.
For comparing two versions, easily spotting the changes and selective merging.
I use an image editor for storing backtest results from [printscreen], with a point on the chart and code changes highlighted. CTRL key in the IDE allows for multiple cursors and then with shift-arrow even multiple lines separated from each other highlighted, for looking at those screenshots later noting which changes had just occurred.
In an editor like Microsoft Word, both images and code can be saved long term, with useful filenames for sorting.