With the incorrect implementation currently, orderbooks have incorrect
entries in them which never get removed. This results in an
unsynchronised state, having issues such as bid prices greater than the
lowest ask prices
The websocket depth updates must be subscribed to before getting a
snapshot. Any updates from the websocket that have earlier update ids
must be discarded.
https://binance-docs.github.io/apidocs/spot/en/#how-to-manage-a-local-order-book-correctly
Signed-off-by: David Ackroyd <daveo.ackroyd@gmail.com>
* * Adds script link to GCT logger package
* Adds ability to save data as csv via script
* addr nits
* go mod tidy
* add glorious suggestion
* rm unused function
* fix linter issues
* clean up some issues
* Add in configuration fields to object for reflection to the csv file
* RM line :D
* address nits
* update to check for target already being set and add more test coverage
* force usage of .csv file extention && append date to client filename as to not overwrite file if collision occurs
* fix whoopsie
* linter issues
* purge getter methods
* Added glorious suggestion
* go mod tidy after merge
* niterinos
Refactoring the timeout retries into a more general 'retry policy' with
support for retrying on HTTP 429 (Too Many Requests) and other responses
with a `Retry-After` header
The delay between requests is controlled by a combination of a 'backoff'
(currently only a simple linear backoff), and honouring the
`Retry-After` value (longest delay wins)
This makes the 'rate limiter' an optional argument as well, removing the
use of `nil` when one isn't supplied
Signed-off-by: David Ackroyd <daveo.ackroyd@gmail.com>
* added mfi and example
* renamed to moving average
* converted to array return type and added obv and mfi
* started work on test coverage
* test coverage added for rsi & mfi
* test coverage added for all indicators removed go mod replace moved to append helper method
* moved all indicators to new appendTo and increased test coverage
* added additional test and bumped go-talib to latest commi
* go.mod update
* linter fixes
* go mod clean up
* small fixes
* reverted changes from previous attempt to rework as data is still incorrect now passing full OHLCV data back to script binding
* testing new structure of passing full ohlcv data
* started linking ohlcv to gctscript
* OHCLV link up completed reworking passing back to indicators started
* OHCLV link up completed reworking passing back to indicators started
* added test coverage for tofloat
* linter fixes (gofmt)
* removed unused value
* improved test coverage
* added correct detection for 1w added ParseInterval test coverage moved OHCLV string to const
* removed unused value
* first round of changes addressed
* all indicators have been split with packages named after each indicator and a new calculate() method added
* linters
* fixed tests
* added check to check ta is running in validator for uploading
* Added test data for OHLCV testing new indicator interface for wrapper
* typed const to float64
* reworked validator data to generate previous timestamps
* rewored macd to return slice of array
* adding bbands linking and example
* why didn't this pick it up before :D
* bumped up total number of modules for test
* moved parseIndicator to exchange added comments
* test coverage added for ParseMAType & ParseIndicatorSelector
* gofmt
* WIP changes
* updated tests for bbands & obv bumped to latest go-talib
* move multiple use strong to const
* reverted rpc.pb.go to master
* added 4w option
* removed selector from obv as unneeded
* improved test coverage and reworked all indicator methods on how they pass errors back
* order incoming OHCLV data
* revert go.mod
* removed verbose toggles
* added spot asset type
* removed 4w as its unused/uncommon
* renamed
* reworked further tests
* converted all examples to use coinbasepro for consistency
* updated all date ranges to 2019 + 6 months
* backported binance OHLCV wrapper from #479
* removed o
* rounded numbers
* chnage requests addressed and attempt to fix MACD... today has been really unproctive code wise :D
* Migrated to gct-ta library
* Corrected test import
* wording changes on test
* removed TA lib from go.mod
* PR changes addressed
Removed parallel running from tests due to slight possibility in very extreme cases TestExecution might not be set to the expected value and will cause lower test coverage
* removed pkg folder
* bumped gct-ta version
* gct-ta version bump
Request types / variations contribute different weights towards the limit
Binance enforces. These can be considerably more than 1 per request,
which results in the server side limits being hit, producing 429 and 418
responses and bans
Several /v1 API calls have been deprecated, and will be removed shortly.
Moving these across to their /v3 equivalents
Capturing of the klines request via the recorder was failing, as it did
not handle the structure where the klines response in an array of
mixed primitive arrays. Excluding primitive values from the exclusion
checks addresses this
* Updates websocket URL
* Minor test changes, URL changes too
* verbosity purposity prepostery
* Fixes issue where websocket data passed through the round trip was invalid
* Adds a test protection
* fix the return problem
* fix the return problem
* add the mandatory parameter
* fix the symbol empity problem
* fix the symbol empty problem
* add Pair parameter for order.Cancel parameters
* follow the gofmt rule
Co-authored-by: MK <mk@MKdeMacBook-Pro.local>
* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value
* removed gctcli executable and added it to gitignore
* implemented GetOrderInfo
* getOrder also has trades attached to an order
* getOrder also has trades attached to an order
* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value
* removed gctcli executable and added it to gitignore
* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value
* removed gctcli executable and added it to gitignore
* minor
* go lint fixes
* removed clutter
* fixed Amount, Executed Amount, Remaining Amount
* removed default value declarations
* removed useless nil chceck
* iteration rewritten go style from java style
* returning error if GetFills fails
* returning error if GetOrderInfo fails
* ExecutedAmont value is FilledSize
* added TODO to fix asset type
* chnages after merging #446
* range without copy value, using index
* removed useless slice initialisation
* couple of nits from code review
* fix indentation
* Update rpc.proto
Fixes indentation
Co-authored-by: Adrian Gallagher <thrasher@addictionsoftware.com>
* Initial changes, removing exchange name as an arg and puts it in the pointer struct. Adds case to ws routines
* Adds CancelAllOrders func, adds GetByExchangeAndID. Adds modify handler in routines.go
* initial poor attempts to have bitmex work with new datahandler handlers. fixes ordersides
* bitmex Completes new order
* Better bitmex handling, but not complete. Begins a gargantuan task of unifying order data structs. Sometimes an order update will contain lot's of information, so its best to be able to update all fields of our orders, rather than just an arbitrary subset. As a result, everything will be broken for the foreseeable future :glitch_crab:
* Removes old order handler which did nothing. Updates order properties for everything everywhere - now consistent. Changes order status. Adds asset type and wallet address to all order types
* Adds order updater to update only relevant fields since the object is generic, we don't know what fields are passed from what exchanges. Adds "lastupdated" field to order.Detail. Expands order cancellation for engine orders.
* Ensures that new orders are added to the ordermanager's order store. Saaa many comments. Internalises orderStore get func. Adds internalOrderID to orderdetail and adds websocket support for it
* Fixes a cancelAllOrders oopsie doopsie
* Adds potential func to update orderdetails from an orderdetail struct. Unsure if will keep.
* Begins btcmarkets implementation. Expands order "stringToOrder" funcs to allow for some more flexible string coversions. Removes order.Submit via websocket as it would cause unlimited order place issues :D
* Finishes btc markets without testing
* Adds untested ws auth func to btse
* Finises btse, fixes btcmarkets bug
* Adds coinbasepro support
* Fixes a few more fields in coinbase pro and readds the extra subs
* Begins work on coinbene. Plus theyve added a new ws connection yeee
* Wasted a bunch of time adding support to an additional websocket that isn't needed ;_; Fixed a bug in coinbasepro. Fully kitted out coinbene support. Updates order types with all fields
* Removes extra websocket connection ;_;
* Finishes gemini. Fixes order side unknown
* Adds okgroup support. Moves byte reading to another function to allow for unit testing. Updates routines to use pointers. Updates date update handling for order details
* Finishes order data for okgroup websocket, but starts the STRANGE process of converting all other websocket endpoints to be a little less silly
* Cleans up okroup websocket implementation. Fixes bug in Gemini
* Adds poloniex support. Updates ws order handling
* new bitmex support. Adds some tests now that its all in its own func. Fixes poloniex bug
* Begins work on authenticated binance websocket
* Attempts to track user data via binance websocket
* Maybe finishes Binance websocket support
* Begins adding test coverage to orders.go. Updates names of script properties to match updated
* Begins an experiment with code coverage. Fixes more rebase issues
* Completes orders coverage. Botches a few other things though. Fixes more scripting stuff
* All tests in engine package pass
* Adds some loevely routine tests
* Moves ordermanager to test Bot ordermanager
Adds lovely routine tests to ensure things that get sent to be handled the data handler are handled by the data handler by handling them
* Replaces "wsHandleData" with "wsReadData" as that's what its going to do now.
* Splits all wsHandleData into wsReadData and wsHandleData to allow for easy testing via sending []byte json examples to test proper functionality. Breaks so many tests
* Fixes majority of test issues. But data races which are tough on the engine package
* "Fixes" test by removing shutdown test. It interferes with too many things. Requires some thought
* Tests all the binance websocket points
* Adds better bitfinex websocket support.
* Adds testing for bitfinex, bitstamp and btcmarkets. Fixes websocket bugs encountered
* Adds BTSE ws tests. Fixes bugs in ws
* Adds coinbase pro tests. Fixes any issues
* Coinbene tests
* Starts to handle coinut. Runs into a problem conceptually regarding websocket roundtrip and orders. Both events need to happen without impacting eachother/racing
* Addresses a data race issue regarding websocket and bot order management submission - order submission locks at an earlier point to prevent routines.go from creating an order before order submission creates it. Updates rpcserver to use order management bot to submit orders.
* Finishes the hectic coinut testing
* Adds tests for gateio
* Fixes rebase issues. Updates tests to work without being overloaded
* Begins testing of gemini. fixes up minor issues
* ginishes gemini tests and fixes
* Adds hitbtc tests. Fixes all the many issues with hitbtc websocket
* Adds remaining tests. Increases default test channel limit again
* Begins work towards huobi tests
* Finishes huobi tests
* Fixed all mythical rebase adventures
* Begins kraken transformation
* Finishes kraken. Fixes coinbene leverage now that its changed
* Begins okgroup testing
* Adds okgroup ws tests
* Does some poloniex
* Fixes basic curreny issue by extracting to func
* Begins redesign of poloniex websocket datahandling. Completes authenticated handling, now onto unauth
* Finishes poloniex revision
* Finishes ZB additions
* Fixes data races
* Fixes rebase issues. Fixes bad kraken logic
* Fixes after reviewing code
* lint everywhere
* Fixes lingering lints
* lint
* Adds test coverage to order detail and modify updating
* Fixes linting
* Fixes huge int, fixes date tests
* Adds GetByExchange, adds test for it. Protects fakepass echange. Renames DisplayQty to DisplayQuantity. Removes verbose. Adds some websocket properties. Updates bitmex asset type in test
* Addresses timestamps, type abbreviations, verbosity. Expands binance kline switch cases. Updates some websocket capabilities.
* Adds coverage to the stringToOrderType/Status functions introduced in PR
* Minor fixes addressing some time, error text and use of StringDataCompareInsensitive
* Introduces shiny new system which checks if there is an awaiting ID, if found, processes via wrapper method, else, goes through wsHandleData method. Removes weird locking system from wrapper/websocket data race. Updates bitfinex to properly handle websocket order requests and notifications
* Moves fakePassingExchange to test_helper. Fixes some order side implementations for trades. Botches a new error type
* Adds new error type to track and handle order classification errors separately
* Fully fleshes out ClassificationError for all instances of status conversion. Even in order trades and some wrapper functions
* Introduces common.SimpleTimeFormat for "2006-01-02 15:04:05". Fixes binance and bitfinex issues with auth endpoint use, map casting. Expands more order.ClassificationError usage. Fixes some more generic websocket response errors
* Future proofs order updating by utilising asset types. Expands testing to accomodate. Adds shiny new time type. Expands wrapper websocket functionality definitions
* minty linty
* Broken end of day code addressing basic nits on comments, returns and currency conversion
* Adds testing to btcmarkets websocket. Also updates websocket orderbook to use update instead
* Fixes fun rebase fun fun so fun
* Addresses minor nits regarding changed interface and comments
* Creates new function `GetRequestFormattedPairAndAssetType` to retrieve a currency pair and asset type based on a string. It will iterate over enabled pairs and compare them to formatted pairs and then return that pair if found.
* Fixes test
* Adds a single line to the end of the file, because that would be really bad if it wasn't there
* Updates fakepassexchange to not use params, updates test params, uses fatal in some tests where its important, updates order manager to have a rwmutex, removes some returns, improves ws key test for binance, updates properties to reflect their actual values, adds some more websocket properties
* Addresses binance switch linting
* Updates leverage property to int64
* Fixes what was broken