* Added TimeInForce type and updated related files
* Linter issue fix and minor coinbasepro type update
* Bitrex consts update
* added unit test and minor changes in bittrex
* Unit tests update
* Fix minor linter issues
* Update TestStringToTimeInForce unit test
* Exchange test template change
* A different approach
* fix conflict with gateio timeInForce
* minor exchange template update
* Minor fix to test_files template
* Update order tests
* Complete updating the order unit tests
* Updating exchange wrapper and test template files
* update kucoin and deribit wrapper to match the time in force change
* minor comment update
* fix time-in-force related test errors
* linter issue fix
* ADD_NEW_EXCHANGE documentation update
* time in force constants, functions and unit tests update
* shift tif policies to TimeInForce
* Update time-in-force, related functions, and unit tests
* fix linter issue and time-in-force processing
* added a good till crossing tif value
* order type fix and fix related tim-in-force entries
* update time-in-force unmarshaling and unit test
* consistency guideline added
* fix time-in-force error in gateio
* linter issue fix
* update based on review comments
* add unit test and fix missing issues
* minor fix and added benchmark unit test
* change GTT to GTC for limit
* fix linter issue
* added time-in-force value to place order param
* fix minor issues based on review comment and move tif code to separate files
* update on exchanges linked to time-in-force
* resolve missing review comments
* minor linter issues fix
* added time-in-force handler and update timeInForce parametered endpoint
* minor fixes based on review
* nits fix
* update based on review
* linter fix
* rm getTimeInForce func and minor change to time-in-force
* minor change
* update based on review comments
* wrappers and time-in-force calling approach
* minor change
* update gateio string to timeInForce conversion and unit test
* update exchange template
* update wrapper template file
* policy comments, and template files update
* rename all exchange types name to Exchange
* update on template files and template generation
* templates and generation code and other updates
* linter issue fix
* added subscriptions and websocket templates
* update ADD_NEW_EXCHANGE.md with recent binance functions and implementations
* rename template files and update unit tests
* minor template and unit test fix
* rename templates and fix on unit tests
* update on template files and documentation
* removed unnecessary tag fix and update templates
* fix Add_NEW_EXCHANGE.md doc file
* formatting, comments, and error checks update on template files
* rename exchange receivers to e and ex for consistency
* rename unit test exchange receiver and minor updates
* linter issues fix
* fix deribit issue and minor style update
* fix test issues caused by receiver change
* raname local variables exchange declaration variables
* update templates comments
* update templates and related comments
* renamed ex to e
* update template comments
* toggle WS to false to improve coverage
* template comments update
* added test coverage to Ws enabled and minor changes
---------
Co-authored-by: Samuel Reid <43227667+cranktakular@users.noreply.github.com>
* tests: Replace !errors.Is(err, target) with testify equivalents
* codebase: Manual !errors.Is(err, target) replacements
* typo: Replace errMisMatchedEvent with errMismatchedEvent
* tests: Enhance error messages for better output
* tests: Refactor error assertions in various test cases to use require and improve clarity
* misc linter: Fix assert should wording
* tests: Simplify assertions in TestCreateSignals for clarity and conciseness
* tests: Enhance assertion message in TestCreateSignals
* GHA, tests: Add additional checks for common issues
These checks include:
- Ensuring that all testify funcs use their formatted variants (e.g., `assert.Equalf(t, expected, actual)` instead of `assert.Equal(t, expected, actual)`).
- Replacing `%s` with %q
- Enforcing consistent usage of should/must wording for testify assert/require messages
* Add support for checking backticked string format specifiers and fix issues
* tests: Fix error comparisons
* tests: Replace errors.Is(err, nil) usage with testify and automate check
* refactor: Rename ExtractPort to ExtractPortOrDefault
* tests: Replace assert with require for error handling in multiple test files
* tests: Replace assert with require for error handling and improve assertions in data tests
* tests: Fix typo in assertion message for StreamVol test
* OKX: Fix GetOpenInterestAndVolumeStrike test with instrument selection and improved assertions
* OKX: Revert intentional error check
* Improve error message for expiry time check in GetOpenInterestAndVolumeStrike test
* Tests: Use currency.NewUSD and NewUSDT
Simple refactor to use the provided shortcut methods
* Github: Add CI check to ensure NewPair not used
Add a step to ensure NewPair(BTC, USD*) isn't used
* golangci-lint: Enable usetesting and unused linters
* tests: Improve assertions in various test cases for clarity and accuracy
* tests: Enhance error assertions in TestExecuteStrategyFromFile for improved clarity
* tests: Update assertions for improved clarity and accuracy
* tests: Replace assert with require for task count checks
* config/versions/v7: Replace context.Background() with t.Context()
* Bithumb: Centralise and consoliate testPair, relax UpdateTickers check
with some glorious Doom Eternal music
* Bithumb: Use UpdatePairsOnce and update remaining pair string
* Bithumb: Add UpdatePairsOnce to TestUpdateTickers
* modernise: Run new gopls modernise tool against codebase
* Address shazbert's nits
* apichecker, gctcli: Simplify HTML scraping functions and improve depth limit handling
* refactor: Create minSyncInterval const and update order book limit handling for binance and binanceUS
* refactor: Various slice usage improvements and rename TODO
* tranches: Revert deleteByID changes due to performance decrease
Shazbert was a F1 driver in a past lifetime 🏎️
* tranches: Simply retrieve copy
Thanks to shazbert
* documentation: Sort contributors list by contributions
* tranches: Remove deadcode in deleteByID
* Config: Move assetEnabled upgrade to Version management
* Assets: Do not error on asset not enabled, or disabled
This became more messy with Disabling something that's defaulted to
disabled.
Taking an idealogical stance against erroring that what you want to have
done is already done.
* CurrencyManager: Set AssetEnabled when StorePairs(enabled)
* RPCServer: Fix tests expecting StoreAssetPairFormat to enable the asset
Also assertifies
* Bitfinex: Fix tests for MarginFunding subs
* GCTWrapper: Improve TestMain clarity
* BTSE: Add futures to testconfig
* Exchanges: Rename StoreAssetPairStore
Previously we were calling it "Format", but accepting everything from
the PairStore.
We were also defaulting to turning the Asset on.
Now callers need to get their AssetEnabled set as they want it, so
there's no magic
This change also moves responsibility for error wrapping outside to the
caller.
* Config: AssetEnabled upgrade should respect assetTypes
Previously we ignored the field and just turned on everything.
I think that was because we couldn't get at the old value.
In either case, we have the option to do better, and respect the
assetEnabled value
* Config: Improve exchange config version upgrade error messages
* build/ci: Update Go to v1.24, golangci-lint to v1.64.5 and fix issues
* Address shazbert's nitters
* linter/config: Fix new linter issue and use versionSize const
* Address gk's nitters and fix additional linter issue after rebase
* Address glorious nits
* staticcheck: Fix additional linter issues after upgrading to Go 1.24.1 and golangci-lint v1.64.6
Also addresses nits
* Improve testing, assertify usage and use common.ErrParsingWSField
* TestCreateNewStrategy: Replace must > should wording
* tag optional sonic and allow full library conversion
* Add workflow and disallow arm and darwin usage
* Add basic hotswap benchmark
* linter: fix
* use bash
* linter: fix?
* Fix whoopsie, add to make file, also add mention in features list.
* test enforcement
* actually read documentation see if this works
* linter: fix
* linter: fix
* sonic: bump tagged version
* encoding/json: drop build tag arch and os filters
* encoding/json: consolidate tests
* encoding/json: log build tag usage
* rm superfluous builds
* glorious/nits: add template change and regen docs
* glorious/nits: update commentary on nolint directive
* glorious/nits: rm init func and log results in main.go
* Test to actually pull flag in
* linter: fix
* thrasher: nits
* gk: nits 4 goflags goooooooooo!
* gk: nits rn
* make sonic default json implementation
* screen 386
* linter: fix
* Add commentary
* glorious: nits Makefile not working
* gk: nits
* gk: nits whoops
* whoopsirino
* mention 32bit systems won't be sonic
* gk: super-duper nit of extremes
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* CI/build: Update Go version, linters and fix minor issues
* linters: Add intrange, copyloopvar, additional go vet linters to match gopls and fix issues
* Add in extra field for colocation monitoring
* rm tags
* populate through gateio orderbooks
* populate through incremental updates
* Add insert at field for orderbook depth
* I AM A BAD SPELLLLLLA
* add it in
* c change
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* initial purge and benchmarks proof before rn overhaul
* rn LinkedList -> Tranche(s) and purge references
* roll out acrost exchanges
* linterino
* rn silly billy label
* linter strikes AAAAAGAIN!
* fix some things
* rm comment
* Add actual comparison from master to branch benchmark for sorting algorithms
* lower case via git mv YAAY!
* drop code
* convert type name
* glorious: nits
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* CI/build: Update Go version, linters and fix minor issues
* Bump golangci-lint to v1.56.1
* BinanceUS: Make uint usage consistent
* Throw blank identifiers into the trash
* engine/gRPC proxy: Fix mux regression and enhance test coverage
* Use a temp dir for TLS creds and add credentials test tables
* Update GetRPCEndpoints grpcProxyName ListenAddr field
* Log unauthorised access attempts
* adds open interest to exchanges
* ADDS TESTING YEAH
* New endpoints, BTSE, RPCS, cached
* slight design change, begin gateio
You will need to get cached for
each exchange that supports it
* gateio, huobi, rpc
* fix up kraken, cache retrieval
* okx, gateio
* finalising all implementations and tests
* definitely my final ever commit on this
* Well, well, well
* final v2
* quick fix of bug
* test coverage, assert notempty, test helper
Added a new testhelper for currency
management because its very annoying
in a parallel test setting which wastes
so much space otherwise
* minimises REST requests for Open Interest
* types.Number merge misses
* Minimises Kraken REST calls
* len change, value -> pointer receiver
* further fixup
* fixes gateio, batch calculates open interest
* single gateio, lint const fixes
* rejig and more thorough oi for huobi
* formatting expansion
* minor fix for handling expiring contracts
* rm unused Binance strings
* add bybit support, fix bybit issues
* oopsie doopsie, dont look at my whoopsie
* Fix issue, remove feature
* move an irrelevant function for the pr
* mini bybit upgrades
* fixes cli request bug
* adds funding rate implementations and improvements
* merge fixes x1
* lint
* kucoin funding rates func make
* migrate sync-manager to keys
* some kucoin work
* adds some kucoin wrapper funcs
* ehhh, todo
* kucoin position
* start of orders
* adds the kucoin tests yay
* multiplier
* nits, EWS includes order limits
* NotYetImplemented, IsPerp improvements, cleaning
* lint, test fix, huobi time
* fixes issues, improves testing
* fixes linters I WRECKED
* local lint but remote lint, lint, lint, lint
* fixes err
* skip CI
* lint
* Supported rates, binance endpoints
* fixes weird mocktest problems
* no, CZ is invalid
* fixes some new EWS test errors
* all in a days work
* cleanup
* cleanup for real, also stop it binance.json
* minor coverage
* adds gateio to the slurry
* cleanup of types
* verbose verbose verbose verbose verbose verbose
* fixes huobi parsing issue
* fix bybit contract identification
* cleanup
* merge fixes
* addresses many big problems raised by SHAZ
* tracking errors and fixes
* funding rate if avail, fixes currency formatting
* Addresses nits and sneaks in extra fixes
* lint
* minor fixes after rebase
* better contract splitter for currencies like T-USDT
* forgot to add the exchange name like a fool
* merge fixes x1
* kucoin, direction, contract size
* rn direction, fix kucoin time
* WHOOPS
* Update exchanges/kucoin/kucoin_wrapper.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* misdirection
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* init
* surprise train commit
* basic distinctions
* the terms of binance are confusing
* renames and introduction of allocatedMargin
* add new margin funcs
* pulling out wires
* implement proper getposition stuff
* bad coding day
* investigate order manager next
* a broken mess, but a progressing one
* finally completes some usdtmargined stuff
* coinMfutures eludes me
* expand to okx
* imports fix
* completes okx wrapper implementations
* cleans and polishes before rpc implementations
* rpc setup, order manager features, exch features
* more rpc, collateral and margin things
* mini test
* looking at rpc response, expansion of features
* reorganising before the storm
* changing how futures requests work
* cleanup and tests of cli usage
* remove silly client side logic
* cleanup
* collateral package, typo fix, margin err, rpc derive
* uses convert.StringToFloat ONLY ON STRUCTS FROM THIS PR
* fix binance order history bug
* niteroos
* adds new funcs to exchange standards testing
* more post merge fixes
* fix binance
* replace simepletimeformat
* fix for merge
* merge fixes
* micro fixes
* order side now required for leverage
* fix up the rest
* global -> portfolio collateral
* Update exchanges/collateral/collateral_test.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* adds fields and todos
* rm field redundancy
* lint fix oopsie daisy
* fixes panic, expands error and cli explanations (sorry shaz)
* ensures casing is appropriate for underlying
* Adds a shiny TODO
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* orderbook: Check assignment of time values and reject if not set.
* linter: fix
* buffer: additional linter winter fixter
* Implement through pending exchanges
* finished push
* linty: minty
* gomod: tidy
* thrasher: nits
* glorious: nits
* orderbook: purge type now in favour of external call allocation
* orderbook: push last param
* orderbook: only 1 unlock call is needed
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* initial concept of a nice validation tester for exchanges
* adds some datahandler design
* expand testing
* more tests and fixes
* minor end of day fix for bithumb
* fixes implementation issues
* more test coverage and improvements, but not sure if i should continue
* fix more wrapper implementations
* adds error type, more fixes
* changes signature, fixes implementations
* fixes more wrapper implementations
* one more bit
* more cleanup
* WOW things work?
* lintle 1/1337
* mini bump
* fixes all linting
* neaten
* GetOrderInfo+ asset pair fixes+improvements
* adds new websocket test
* expand ws testing
* fix bug, expand tests, improve implementation
* code coverage of a lot of new codes
* fixes everything
* reverts accidental changes
* minor fixes from reviewing code
* removes Bitfinex cancelBatchOrder implementation
* fixes dumb baby typo for babies
* mini nit fixes
* so many nits to address
* addresses all the nits
* Titlecase
* switcheroo
* removes websocket testing for now
* fix appveyor, minor test fix
* fixes typo, re-kindles killed kode
* skip binance wrapper tests when running CI
* expired context, huobi okx fixes
* kodespull
* fix ordering
* time fix because why not
* fix exmo, others
* hopefully this fixes all of my life's problems
* last thing today
* huobi, more like hypotrophy
* golangci-lint, more like mypooroldknee-splint
* fix huobi times by removing them
* should fix okx currency issues
* blocks the application
* adds last little contingency for pairs
* addresses most nits and new problems
* lovely fixed before seeing why okx sucks
* fixes issues with okx websocket
* the classic receieieivaier
* lintle
* adds test and fixes existing tests
* expands error handling messages during setup
* fixes dumb okx bugs introduced
* quick fix for lint and exmo
* fixes nixes
* fix exmo deposit issue
* lint
* fixes issue with extra asset runs missing
* fix surprise race
* all the lint and merge fixes
* fixes surprise bugs in OKx
* fixes issues with times and chains
* fixing all the merge stuff
* merge fix
* rm logs and a panic potential
* lovely lint lament
* an easy demonstration of scenario, but not of initial purpose
* put it in the bin
* Revert "put it in the bin"
This reverts commit 15c6490f713233d43f10957367fcbf18e3818bdd.
* re-add after immediate error popup
* fix mini poor test design
* okx okay
* merge fixes
* fixes issues discovered in lovely test
* I FORGOT TO COMMIT THIS
* nit fixaroonaboo
* forgoetten test fix
* revert old okx asset intrument work
* fixes
* revert problems I didnt understand. update bybit
* fix merge bugs
* test cleanup
* further improvements
* reshuffle and lint
* rm redundant CI_TEST by rm the CI_TEST field that is redundant
* path fix
* move to its own section, dont run on 32 bit + appveyor
* lint
* fix lbank
* address nits
* let it rip
* fix failing test time range
* niteroo boogaloo
* mod tidy, use common.SimpleTimeFormat
* exchanges: add setTimeWindow boolean to GetKlineRequest params to differentiate between a set time period return from endpoint.
* glorious: nits
* exchange: conjugation
* Update exchanges/exchange.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits and an assortment of differences
* exchanges: remove some comments
* glorious: nits
* cleanup
* tests: fix
* Update exchanges/hitbtc/hitbtc_wrapper.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/kline/kline.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/kline/kline_test.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* kline: fix test
* rm unused variables
* almost: nits
* glorious: nits
* linter: fix
* rm unused variable
* Refactored comment in the okex tests to ensure that it accurately reflects the variable name and the issue related to the time window, as requested by GloriousCode. The previous comment did not align with the identifier assigned to the property, which could cause confusion and misunderstanding among other programmers or stakeholders. The updated comment will improve the clarity and readability of the codebase and make it easier to understand the intended purpose of the associated variables. The change was made with the aim of improving the overall quality and maintainability of the code.
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* engine: shutdown and unload exchange when engine is stopped
* linter: fixes
* engine/exchMan: add nil check
* engine/exchanges: add shutdown method to exchanges, rm len check lock not needed, expanded code coverage, address some nits
* exchMan: report all failed shutdowns across exchanges, implement timer and monitoring routines.
* exchMan: improve shutdown sequence and aloc.
* further improvement
* exchman: log from warn to error
* websockconnection: Suppress error return when closure is caused by library
* linter: fix
* fix racies
* add note on why not parallel tests
* glorious: nits
* spelling kween
* thrasher: nits
* engine: change print of setting using reflection, I keep forgetting to implement this so program around forgetfulness
* engine/exchange_management: remove wait group and just rely on intermediary lock
* glorious: nits
* Update common/common.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update main.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* add backtester support
* Prevent live data custom candles, prevent nanosecond candles
* test coverage
* a more interesting rsi strategy result
* actual custom candle and proper strat date
* add test to old funk
* typos 🌞🌞
* this was definitely worth failing linting for
* Adds stricter processing and adapts to it
* now compat with partial and absent candles
* test fixes, zb fixes
* fix more introduced bugeroos
* fix more introduced bugeroosx2
* linting for one space is so annoying
* addresseroos niteroos
* Update backtester/engine/setup.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* kline: Add builder and testing
* Ideas
* kline: deploy builder functionality across GCT
* exchanges: implement across gct
* exchanges: Add tests and fix implementations before kline package testing and veri.
* kline: Add tests and start to fix ConvertToNewInterval
* kline: fix ConvertToNewInterval add tests
* kline: complete overarching tests now on to exchanges
* kline: finish exchange tests and implement limits
* exchanges: more fixes
* linter: fix
* engine: fix tests
* kraken: fix recent trades and other fixes
* zb: fix tests
* bithumb: fix empty insertion
* kline: refactor/optimize CreateKline function
* kline: remove the mooos!
* kline: prealloc CalculateCandleDateRanges
* linter: fix
* exchanges: prealloc extended
* fix whoopsie
* reverse fix because this is a whoopsie
* okx: fix risidual issues
* linter: fix
* kline: initial nits from @gloriouscode
* kline: rename builder -> request and cascade change
* linter: fix + test
* kline: update forced alignment on start and end times when CreateKlineRequest is called.
* nits: more more more
* NITS: Addressed
* tests: fix race issue
* Update exchanges/kline/request.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* kline: add method AddPadding() to automatically fill in holes in kline.Request functionality and reject if missing data when converting
* kline: Add params start and end to addPadding() to insert blanks in between block
* kline: remove test comment code as it's not needed anymore
* kline: fix lint and test
* kline: sort slice without extra bool check every iteration
* okx: fix issues with timeing and candles and such from niterinos & address typo
* Update exchanges/kline/kline.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: niterinos
* Update exchanges/poloniex/poloniex_wrapper.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits now onto conflicts YAYA!!!
* Update exchanges/exchange_test.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits again
* thrasher: nitters
* thrasher: niterinos - adds partial flag for incomplete recent candles and fetching.
* kline: rm fmtizzle packageizzle
* glorious: nitters
* glorious: more niterinos
* fix last niterinos
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Modifications for a smoother live run
* Fixes data appending
* Successfully allows multi-currency live trading. Adds multiple currencies to live DCA strategy
* Attempting to get cash and carry working
* Poor attempts at sorting out data and appending it properly with USD in mind
* =designs new live data handler
* Updates cash and carry strat to work
* adds test coverage. begins closeallpositions function
* Updates cash and carry to work live
* New kline.Event type. Cancels orders on close. Rn types
* =Fixes USD funding issue
* =fixes tests
* fixes tests AGAIN
* adds coverage to close all orders
* crummy tests, should override
* more tests
* more tests
* more coverage
* removes scourge of currency.Pair maps. More tests
* missed currency stuff
* Fixes USD data issue & collateral issue. Needs to close ALL orders
* Now triggers updates on the very first data entry
* All my problems are solved now????
* fixes tests, extends coverage
* there is some really funky candle stuff going on
* my brain is melting
* better shutdown management, fixes freezing bug
* fixes data duplication issues, adds retries to requests
* reduces logging, adds verbose options
* expands coverage over all new functionality
* fixes fun bug from curr == curr to curr.Equal(curr)
* fixes setup issues and tests
* starts adding external wallet amounts for funding
* more setup for assets
* setup live fund calcs and placing orders
* successfully performs automated cash and carry
* merge fixes
* funding properly set at all times
* fixes some bugs, need to address currencystatistics still
* adds 'appeneded' trait, attempts to fix some stats
* fixes stat bugs, adds cool new fetchfees feature
* fixes terrible processing bugs
* tightens realorder stats, sadly loses some live stats
* this actually sets everything correctly for bothcd ..cd ..cd ..cd ..cd ..!
* fix tests
* coverage
* beautiful new test coverage
* docs
* adds new fee getter delayer
* commits from the correct directory
* Lint
* adds verbose to fund manager
* Fix bug in t2b2 strat. Update dca live config. Docs
* go mod tidy
* update buf
* buf + test improvement
* Post merge fixes
* fixes surprise offset bug
* fix sizing restrictions for cash and carry
* fix server lints
* merge fixes
* test fixesss
* lintle fixles
* slowloris
* rn run to task, bug fixes, close all on close
* rpc lint and fixes
* bugfix: order manager not processing orders properly
* somewhat addresses nits
* absolutely broken end of day commit
* absolutely massive knockon effects from nits
* massive knockon effects continue
* fixes things
* address remaining nits
* jk now fixes things
* addresses the easier nits
* more nit fixers
* more niterinos addressederinos
* refactors holdings and does some nits
* so buf
* addresses some nits, fixes holdings bugs
* cleanup
* attempts to fix alert chans to prevent many chans waiting?
* terrible code, will revert
* to be reviewed in detail tomorrow
* Fixes up channel system
* smashes those nits
* fixes extra candles, fixes collateral bug, tests
* fixes data races, introduces reflection
* more checks n tests
* Fixes cash and carry issues. Fixes more cool bugs
* fixes ~typer~ typo
* replace spot strats from ftx to binance
* fixes all the tests I just destroyed
* removes example path, rm verbose
* 1) what 2) removes FTX references from the Backtester
* renamed, non-working strategies
* Removes FTX references almost as fast as sbf removes funds
* regen docs, add contrib names,sort contrib names
* fixes merge renamings
* Addresses nits. Fixes setting API credentials. Fixes Binance limit retrieval
* Fixes live order bugs with real orders and without
* Apply suggestions from code review
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update backtester/engine/live.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update backtester/engine/live.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update backtester/config/strategyconfigbuilder/main.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* updates docs
* even better docs
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Adds basic PoC for calculating/retrieving position data
* A very unfortunate day of miscalculations
* Adds position summary and funding rate details to RPC
* Offline funding rate calculations
* More helpers, more stats, refining data, automated retrieval
* Adds new rpc server commands and attempts some organisation
* lower string, lower stress
* Adds ordermanager config. Fleshes outcli. Tracks positions automatically
* Adds new separation for funding payments/rates
* Combines funding rates and payments
* Fun test coverage
* ALL THE TESTS... I hope
* Fixes
* polishes ftx tests. improves perp check. Loops rates
* Final touches before nit attax
* buff 💪
* Stops NotYetImplemented spam with one simple trick!
* Some lovely little niteroos
* linteroo
* Clarifies a couple of errors to help narrow likely end user problems
* Fixes asset type bug, fixes closed position order return, fixes unset status bug
* Fixes order manager handling when no rates are available yet
* Continues on no funding rates instead. Removes err
* Don't show predicted rate if the time is zero
* Addresses scenario with no funding rate payments
* Bug fixes and commentary before updating maps to use *currency.Item
* Adds a pair key type
* Polishes pKey, fixes map order bug
* key is not a property in the event someone changes the base/quote
* Adds improvements to order processing...Breaks it all
* Shakes up the design of things by removing a function
* Fixes issues with order manager positions. Limits update range
* Fixes build issues. Identification of bad tests.
* Merges and fixes features from master and this branch
* buff linter 💪
* re-gen
* proto regen
* Addresses some nits. But not all of them.
* Fixes issue where funding rates weren't returned 🎉
* completes transition futures tracking to map[*currency.Item]map[*currency.Item]
* who did that? not me
* removes redundant check on account of being redundant and unnecessary
* so buf
* addresses nits: duplications, startTime, loops, go tidy, typos
* fixes minor mistakes
* fixes 🍣🐻 changes to int64
* Adds lending rates/borrows to FTX and the command
* Movements, renames, rpc test
* Fleshing out rpc response
* Allows rpcserver to calculate offline (but not gctcli). Expands tests
* rn structs. add exchange_wrapper_issues support
* Adds a nice yearly rate
* Surprise yearly borrow rate!
* Rn+Mv to margin package. Fixes some serious whoopsies
* Adds average lend/borrow rates instead of sum
* rm oopsie whoopsie
* This is what the linter was having an issue with
* re-gen
* lintl
* niteroos
* implements futures functions and GRPC functions on new branch
* lint and test fixes
* Fix uneven split pnl. Adds collateral weight test. docs. New clear func
* Test protection if someone has zero collateral
* Uses string instead of double for accuracy
* Fixes old code panic
* context, match, docs
* Addresses Shazniterinos, var names, expanded tests
* Returns subaccount name, provides USD values when offlinecalc
* Fixes oopsie
* Fixes cool bug which allowed made up subaccount results
* Subaccount override on FTX, subaccount results for collateral
* Strenghten collateral account info checks. Improve FTX test
* English is my first language
* Fixes oopsies
* Adds some conceptual futures order details to track PNL
* Initial design of future order processing in the backtester
* Introduces futures concept for collateral and spot/futures config diffs
* Fixes most tests
* Simple designs for collateral funding pair concept
* Expands interface use so much it hurts
* Implements more collateral interfaces
* Adds liquidation, adds strategy, struggles with Binance
* Attempts at getting FTX to work
* Adds calculatePNL as a wrapper function and adds an `IsFutures` asset check
* Successfully loads backtester with collateral currency
* Fails to really get much going for supporting futures
* Merges master changes
* Fleshes out how FTX processes collateral
* Further FTX collateral workings
* hooks up more ftx collateral and pnl calculations
* more funcs to flesh out handling
* Adds more links, just can't fit the pieces together :(
* Greatly expands futures order processing
* Fleshes out position tracker to also handle asset and exchange +testing
* RM linkedOrderID. rn positioncontroller, unexport
* Successfully tracks futures order positions
* Fails to calculate PNL
* Calculates pnl from orders accurately with exception to flipping orders
* Calculates PNL from orders
* Adds another controller layer to make it ez from orderstore
* Backtester now compiles. Adds test coverage
* labels things add scaling collateral test
* Calculates pnl in line with fees
* Mostly accurate PNL, with exception to appending with diff prices
* Adds locks, adds rpc function
* grpc implementations
* Gracefully handles rpc function
* beautiful tests!
* rejiggles tests to polish
* Finishes FTX testing, adds comments
* Exposes collateral calculations to rpc
* Adds commands and testing for rpcserver.go functions
* Increase testing and fix up backtester code
* Returns cool changes to original branch
* end of day fixes
* Fixing some tests
* Fixing tests 🎉
* Fixes all the tests
* Splits the backtester setup and running into different files
* Merge, minor fixes
* Messing with some strategy updates
* Failed understanding at collateral usage
* Begins the creation of cash and carry strategy
* Adds underlying pair, adds filldependentevent for futures
* Completes fill prerequsite event implementation. Can't short though
* Some bug fixes
* investigating funds
* CAN NOW CREATE A SHORT ORDER
* Minor change in short size
* Fixes for unrealised PNL & collateral rendering
* Fixes lint and tests
* Adds some verbosity
* Updates to pnl calc
* Tracks pnl for short orders, minor update to strategy
* Close and open event based on conditions
* Adds pnl data for currency statistics
* Working through PNL calculation automatically. Now panics
* Adds tracking, is blocked from design
* Work to flesh out closing a position
* vain attempts at tracking zeroing out bugs
* woww, super fun new subloggers 🎉
* Begins attempt at automatically handling contracts and collateral based on direction
* Merge master + fixes
* Investigating issues with pnl and holdings
* Minor pnl fixes
* Fixes future position sizing, needs contract sizing
* Can render pnl results, focussing on funding statistics
* tracking candles for futures, but why not btc
* Improves funding statistics
* Colours and stats
* Fixes collateral and snapshot bugs
* Completes test
* Fixes totals bug
* Fix double buy, expand stats, fixes usd totals, introduce interface
* Begins report formatting and calculations
* Appends pnl to receiving curr. Fixes map[time]. accurate USD
* Improves report output rendering
* PNL stats in report. New tests for futures
* Fixes existing tests before adding new coverage
* Test coverage
* Completes portfolio coverage
* Increase coverage exchange, portfolio. fix size bug. NEW CHART
* WHAT IS GOING ON WITH PNL
* Fixes PNL calculation. Adds ability to skip om futures tracking
* minor commit before merge
* Adds basic liquidation to backtester
* Changes liquidation to order based
* Liquidationnnnnn
* Further fleshes out liquidations
* Completes liquidations in a honorable manner. Adds AppendReasonf
* Beginnings of spot futures gap chart. Needs to link currencies to render difference
* Removes fake liquidation. Adds cool new chart
* Fixes somet tests,allows for zero fee value v nil distinction,New tests
* Some annoying test fixes that took too long
* portfolio coverage
* holding coverage, privatisation funding
* Testwork
* boring tests
* engine coverage
* More backtesting coverage
* Funding, strategy, report test coverage
* Completes coverage of report package
* Documentation, fixes some assumptions on asset errors
* Changes before master merge
* Lint and Tests
* defaults to non-coloured rendering
* Chart rendering
* Fixes surprise non-local-lints
* Niterinos to the extremeos
* Fixes merge problems
* The linter splintered across the glinting plinths
* Many nits addressed. Now sells spot position on final candle
* Adds forgotten coverage
* Adds ability to size futures contracts to match spot positions.
* fixes order sell sizing
* Adds tests to sizing. Fixes charting issue
* clint splintered the linters with flint
* Improves stats, stat rendering
* minifix
* Fixes tests and fee bug
* Merge fixeroos
* Microfixes
* Updates orderPNL on first Correctly utilises fees. Adds committed funds
* New base funcs. New order summary
* Fun test updates
* Fix logo colouring
* Fixes niteroonies
* Fix report
* BAD COMMIT
* Fixes funding issues.Updates default fee rates.Combines cashcarry case
* doc regen
* Now returns err
* Fixes sizing bug issue introduced in PR
* Fixes fun fee/total US value bug
* Fix chart bug. Show log charts with disclaimer
* sellside fee
* fixes fee and slippage view
* Fixed slippage price issue
* Fixes calculation and removes rendering
* Fixes stats and some rendering
* Merge fix
* Fixes merge issues
* go mod tidy, lint updates
* New linter attempt
* Version bump in appveyor and makefile
* Regex filename, config fixes, template h2 fixes
* Removes bad stats.
* neatens config builder. Moves filename generator
* Fixes issue where linter wants to fix my spelling
* Fixes pointers and starts
* orders: deprecate SubmitResponse return and change to *order.Detail construct detail from order.Submit struct
* orders: add coverage, fix tests
* coinut: rm test for checking
* orders: revert change for return and change field ID to a more explicit name OrderID
* orders: Add method to see if the order was placed
* order: change field name in Cancel type to be more explicit
* orders: standardize field -> OrderID
* backtester: populate change
* orders: add test
* gctscript: fix field name
* linter: fix issues
* linter: more fixes
* linter: forever
* exchanges_tests: populate order.Submit field exchange name
* Update exchanges/order/order_types.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/order/orders.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* glorious: nits
* thrasher: nits
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* order: slight optimizations
* orders: add benchmarks, small optimize and change order side to uin8 for comparitive optimizations.
* orders: continue to convert string type -> uint
* orders/backtester: interim move type to orders package, later can expand or deprecate.
* orders: handle errors
* orders: optimize filters and remove error returns when its clearly not needed
* orders: remove log call
* backtester: zero value check
* orders/futures: zero value -> flag
* linter: fix
* linter: more fixes
* linters: rides again
* glorious: nits
* common: Add zero value unix check for time values; also addresses glorious nits
* glorious scott: nits
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
* test: use `T.TempDir` to create temporary test directory
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.
Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
defer func() {
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
is also tedious, but `t.TempDir` handles this for us nicely.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* test: fix TestEncryptTwiceReusesSaltButNewCipher on Windows
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* test: fix TestCheckConnection on Windows
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* test: fix TestRPCServer_GetTicker_LastUpdatedNanos on Windows
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* test: cleanup TestGenerateReport
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>