trade

Trade.

The module will execute the arbitrage opportunities for you as it finds them. Currently two arbitrage models are being used: 1.Triangular Arbitrage. 2.Bellman Ford Optimization.

trade.execute_bellman_ford(client: kucoin.client.Trade) bool

Execute Bellman Ford Trading Opportunity.

trade.execute_fwd_tri_arbitrage(client: kucoin.client.Trade, row: pandas.core.frame.DataFrame, cost: float) bool

Execute Forward Triangle Arbitrage.

Using the amount that you are willing to initially spend in fiat per triangular trade (3 trades), execute all trades one after the other immediately and check for their success. If the trade is not successful, discard trade completely. Time in force set as ‘Fill or Kill’ to force trade to be filled, no partial filled trades allowed.

Parameters
  • client – Trade module for kucoin.client.

  • row – Dataframe containing pricing and volume information for tickers.

  • cost – initial trade cost.

Returns

Shows if trade successful or not.

Return type

boolean

trade.execute_rev_tri_arbitrage(client: kucoin.client.Trade, row: pandas.core.frame.DataFrame, cost: float) bool

Execute Reverse Triangle Arbitrage.

Using the amount that you are willing to initially spend in fiat per triangular trade (3 trades), execute all trades one after the other immediately and check for their success. If the trade is not successful, discard trade completely. Time in force set as ‘Fill or Kill’ to force trade to be filled, no partial filled trades allowed.

Parameters
  • client – Trade module for kucoin.client.

  • row – Dataframe containing pricing and volume information for tickers.

  • cost – initial trade cost.

Returns

Shows if trade successful or not.

Return type

boolean

trade.execute_triangular_arbitrage()

Execute Triangular Arbitrage.

trade.order_handling(order: dict) bool

Check if order went through.

Requires analysis.py to be running in real time for trade info collection into DB.

Parameters

order – order dictionary containing order ID.

Returns

Shows if order is has been executed in exchange or not.

Return type

boolean