mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 23:16:53 +00:00
Exchanges: Add in exchange defined tolerance settings (#647)
* Exchanges: Add in exchange defined tolerance settings to conform to min max amounts/price/notional etc (Initial) * Add to tests fix linter * Binance: Implement CMF and usdtMarginFutures fetching of currency information, addr nits * binance: Add in test for tolerance set up * exchanges: add in more tolerance settings and add tests * nits: addr * fix linter issue * RPCServer: Use ordermanager instead of going direct to exchange * Nits: Addr * nits: glorious addr phase one * nits: glorious nits phase 2 * exchange: move tolerance -> limits in order package add wrapper function, split binance functions to asset files * nits: Addr thrasher + also include locking of limits struct when we update via syncer later on * nits: mdc addr * nits: glorious nits * limits: unexport mutex * limit: revert maths optim. and fix spelling * limit: Add decimal package * limit: don't check price on market order * Orders: Add order execution checks on fake orders so as to always conform to tight specifications even in simulation * binance: handle case where spot is not enabled but margin is * backtester: add in amount conforming to back tested events to simulate realistic orders * rm ln * order limit: return amount when limit is nil and conformToAmount is requested * nits: glorious nits + friends * backtester/orders: fix tests * nits: glorious nits * nits: glorious nits * RMLINE * nits: more glorious nits! * nits: pooosh * binance: fix margin logic * nits: Add warning, settings log and report item for exchange order execution limits * backtester: add specific warnings in report output * backtest: Adjust warnings
This commit is contained in:
@@ -986,11 +986,6 @@ func (s *RPCServer) GetOrder(_ context.Context, r *gctrpc.GetOrderRequest) (*gct
|
||||
// SubmitOrder submits an order specified by exchange, currency pair and asset
|
||||
// type
|
||||
func (s *RPCServer) SubmitOrder(_ context.Context, r *gctrpc.SubmitOrderRequest) (*gctrpc.SubmitOrderResponse, error) {
|
||||
exch := s.GetExchangeByName(r.Exchange)
|
||||
if exch == nil {
|
||||
return nil, errExchangeNotLoaded
|
||||
}
|
||||
|
||||
p, err := currency.NewPairFromStrings(r.Pair.Base, r.Pair.Quote)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1012,7 +1007,7 @@ func (s *RPCServer) SubmitOrder(_ context.Context, r *gctrpc.SubmitOrderRequest)
|
||||
AssetType: a,
|
||||
}
|
||||
|
||||
resp, err := exch.SubmitOrder(submission)
|
||||
resp, err := s.OrderManager.Submit(submission)
|
||||
if err != nil {
|
||||
return &gctrpc.SubmitOrderResponse{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user