Backtesting is the method for seeing how well a strategy would have done. The following backtesting functions are provided for evaluating strategies.
The ApplyActions takes the given list of prices, applies the given list of normalized actions, and returns the gains.
gains := indicator.ApplyActions(prices, actions)
The CountTransactions takes a list of normalized actions, and counts the BUY and SELL actions.
count := indicator.CountTransactions(actions)
The NormalizeActions takes a list of independenc actions, such as SELL, SELL, BUY, SELL, HOLD, SELL, and produces a normalized list where the actions are following the proper BUY, HOLD, SELL, HOLD order.
normalized := indicator.NormalizeActions(actions)
The NormalizeGains takes the given list of prices, calculates the price gains, subtracts it from the given list of gains.
normalizedGains := indicator.NormalizeGains(prices, gains)
The information provided on this project is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.
Copyright (c) 2021 Onur Cinar. All Rights Reserved.
The source code is provided under MIT License.