nova-backtest: Historical candles into a strategy simulation
nova-backtest is an archived fork of a strategy-backtesting framework. The core class selects an exchange client, loads a historical interval and manages a simulated bankroll and position constraints.
Repository languagesPython 99.74%2
Shares calculated from GitHub Linguist bytes.
| Language | % | Bytes |
|---|---|---|
| Python | 219,181 | |
| Dockerfile | 572 |
Overview
Why it exists
Financial backtesting framework interfacing with centralized crypto exchange APIs for quantitative strategy testing.
Best fit
Algorithmic trading strategy validation on historical tick data.
Getting started
These commands come from the repository documentation. They were not run during this review.
Repository references
Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.
Development and contributions
Nova Backtest
README.md
Features and components 2
- Inputs and clients
- BackTest receives exchange, strategy name, candle interval, pair list and start/end times. It constructs a client through the clients factory and loads the exchange fee assumptions from FEES.
- Simulation state
- The constructor stores initial and current bankroll, leverage, maximum positions and holding duration. Geometric sizing is an explicit option. Reports depend on these assumptions as well as the strategy’s signals.
Architecture
The components and their connections remain available as text. The diagram adds an interactive view.
- Exchange history
- Client and candle data
- Strategy signals
- Position and bankroll simulation
- Backtest outputs
Links verified in the repository.
Mermaid Interactive diagram (loads on open)
System overview of the components and connections verified in the repository.

flowchart LR
n0["Exchange history"]
n1["Client and candle data"]
n2["Strategy signals"]
n3["Position and bankroll simulation"]
n4["Backtest outputs"]
n0 --> n1
n1 --> n2
n2 --> n3
n3 --> n4
Text version of the diagram
- Exchange history → Client and candle data
- Client and candle data → Strategy signals
- Strategy signals → Position and bankroll simulation
- Position and bankroll simulation → Backtest outputs
Follow one path through the code
Read the BackTest constructor before interpreting a chart. Fees, leverage and position sizing affect the simulated equity path; changing one creates a different experiment even with identical candles.
Types and file structure
12 declared types, with 12 in the base-relationship overview.
Type diagram
classDiagram
direction TB
class tb3e6c9c2ecdf["BackTest"] {
__init__()
build_indicators()
entry_strategy()
exit_strategy()
}
class t49d28ff7fba3["Binance"] {
__init__()
_send_request()
get_server_time()
_format_long_short_ratio()
}
class t43ce1fc5ef4d["BTCEX"] {
__init__()
_send_request()
connect()
logout()
}
class t8174f5fcb687["Bybit"] {
__init__()
_send_request()
get_server_time()
_get_candles()
}
class t023ef983e730["BackTestClientInterface"] {
_send_request()
get_server_time()
_get_candles()
_get_earliest_timestamp()
}
class ta838910fd595["Huobi"] {
__init__()
generate_signature()
_send_request()
get_server_time()
}
class t6d6671499620["Kucoin"] {
__init__()
_send_request()
get_server_time()
get_pairs_info()
}
class tee704ca1b99b["MEXC"] {
__init__()
_send_request()
get_server_time()
get_pairs_info()
}
class te95be47be1da["Oanda"] {
__init__()
_send_request()
get_server_time()
get_pairs_info()
}
class t263161a52c7a["OKX"] {
__init__()
_send_request()
get_server_time()
get_pairs_info()
}
class tf549b99afce0["SaveOrderBook"] {
__init__()
initiate_client()
get_list_pair_binance()
get_list_pair_ftx()
}
class t3e20d5d192c0["TechnicalIndicatorsCreation"] {
__init__()
format_time_for_df()
_get_buffer_length()
get_selected_indicators()
}
class be18d1eb0e880["BackTestClientInterface"] {
<<unresolved_base>>
}
be18d1eb0e880 <|-- t49d28ff7fba3
class b67f7ade18a4f["BackTestClientInterface"] {
<<unresolved_base>>
}
b67f7ade18a4f <|-- t43ce1fc5ef4d
class bfb52a00bc764["BackTestClientInterface"] {
<<unresolved_base>>
}
bfb52a00bc764 <|-- t8174f5fcb687
class bebd830f94387["abc.ABC"] {
<<unresolved_base>>
}
bebd830f94387 <|-- t023ef983e730
class b989f1678d5c0["BackTestClientInterface"] {
<<unresolved_base>>
}
b989f1678d5c0 <|-- ta838910fd595
class b6644718ebc43["BackTestClientInterface"] {
<<unresolved_base>>
}
b6644718ebc43 <|-- t6d6671499620
class b09cf4bf8f343["BackTestClientInterface"] {
<<unresolved_base>>
}
b09cf4bf8f343 <|-- t263161a52c7a
Unresolved bases remain labelled; full signatures are not reconstructed.
Type index
BackTest(class) ·novalabs-backtest/utils/backtest.py:21Methods in the overview:
__init__, build_indicators, entry_strategy, exit_strategy.Binance(class) ·novalabs-backtest/clients/binance.py:12Methods in the overview:
__init__, _send_request, get_server_time, _format_long_short_ratio.Declared bases:
BackTestClientInterface.BTCEX(class) ·novalabs-backtest/clients/btcex.py:11Methods in the overview:
__init__, _send_request, connect, logout.Declared bases:
BackTestClientInterface.Bybit(class) ·novalabs-backtest/clients/bybit.py:13Methods in the overview:
__init__, _send_request, get_server_time, _get_candles.Declared bases:
BackTestClientInterface.BackTestClientInterface(class) ·novalabs-backtest/clients/client_interface.py:5Methods in the overview:
_send_request, get_server_time, _get_candles, _get_earliest_timestamp.Declared bases:
abc.ABC.Huobi(class) ·novalabs-backtest/clients/huobi.py:15Methods in the overview:
__init__, generate_signature, _send_request, get_server_time.Declared bases:
BackTestClientInterface.Kucoin(class) ·novalabs-backtest/clients/kucoin.py:15Methods in the overview:
__init__, _send_request, get_server_time, get_pairs_info.Declared bases:
BackTestClientInterface.MEXC(class) ·novalabs-backtest/clients/mexc.py:12Methods in the overview:
__init__, _send_request, get_server_time, get_pairs_info.Oanda(class) ·novalabs-backtest/clients/oanda.py:12Methods in the overview:
__init__, _send_request, get_server_time, get_pairs_info.OKX(class) ·novalabs-backtest/clients/okx.py:15Methods in the overview:
__init__, _send_request, get_server_time, get_pairs_info.Declared bases:
BackTestClientInterface.SaveOrderBook(class) ·novalabs-backtest/data/orderbook.py:18Methods in the overview:
__init__, initiate_client, get_list_pair_binance, get_list_pair_ftx.TechnicalIndicatorsCreation(class) ·novalabs-backtest/utils/indicators.py:130Methods in the overview:
__init__, format_time_for_df, _get_buffer_length, get_selected_indicators.
Reference
36 / 36 eligible files read (60 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.
What the scan covers
Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.
Linguist statistics cover the whole repository and may include other languages.
File map
flowchart TD
root["nova-backtest"]
f0["README.md"]
root --> f0
f1["novalabs-backtest/utils/backtest.py"]
root --> f1
f2["novalabs-backtest/utils/constant.py"]
root --> f2
f3["pyproject.toml"]
root --> f3
f4["requirements.txt"]
root --> f4
f5["setup.py"]
root --> f5
f6["novalabs-backtest/__init__.py"]
root --> f6
f7["novalabs-backtest/clients/__init__.py"]
root --> f7
f8["novalabs-backtest/clients/binance.py"]
root --> f8
f9["novalabs-backtest/clients/btcex.py"]
root --> f9
f10["novalabs-backtest/clients/bybit.py"]
root --> f10
f11["novalabs-backtest/clients/client_interface.py"]
root --> f11
f12["novalabs-backtest/clients/clients.py"]
root --> f12
f13["novalabs-backtest/clients/huobi.py"]
root --> f13
f14["novalabs-backtest/clients/kucoin.py"]
root --> f14
f15["novalabs-backtest/clients/mexc.py"]
root --> f15