Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 1.77 KB

backtest.md

File metadata and controls

50 lines (31 loc) · 1.77 KB

Backtest

Backtesting is the method for seeing how well a strategy would have done. The following backtesting functions are provided for evaluating strategies.

Apply Actions

The ApplyActions takes the given list of prices, applies the given list of normalized actions, and returns the gains.

gains := indicator.ApplyActions(prices, actions)

Count Transactions

The CountTransactions takes a list of normalized actions, and counts the BUY and SELL actions.

count := indicator.CountTransactions(actions)

Normalize 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)

Normalize Gains

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)

Disclaimer

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.

License

Copyright (c) 2021 Onur Cinar. All Rights Reserved.

The source code is provided under MIT License.