Skip to content

2 simple trading strategy examples #4

@ConanMishler

Description

@ConanMishler

Write a simple example of a working arbitrage strategy, and also of a simple mirroring strategy. Both of these strategies should monitor the order(s) involved in the trade for cancellation (or for significant price change in the case of Pangolin/Uniswap). If an order on which an arbitrage or mirroring trade is dependent gets cancelled, the corresponding arbitrage or mirroring trade should immediately be cancelled.

Also, Write a CSV record of every executed trade, at trade time, listing all of the parameters required to accurately value the trade and the resulting profit/loss.

Lastly, the code will have to be well documented so those copying & modifying it can easily understand each part.

Strategy 1 (arbitrage):
Look for > X% price difference between bid/ask on BlockDX exchange and the complementary ask/bid of the same asset on a different exchange. Then execute a buy of the asset on the exchange w/ lower price while executing a sell of the same amount of the asset on the exchange with the higher price.

Strategy 2 (order mirroring):
Look for NO bid/ask offers on BlockDX exchange within X% of the "best" bid/ask price on all other tracked exchanges. If this condition is met, place a bid/ask order on the BlockDX exchange.
For example, Look for the best (highest) bid order for BLOCK on all tracked exchanges. If the highest bid order on BlockDX is not within X% of the highest bid on all other exchanges, place a bid on BlockDX at some user-defined % discount from the highest bid price on other exchanges.
User should be able to define a set of approximate order quantities for which the bot should attempt mirroring. The bot should factor in market depth before placing a mirroring order. For example, if it's mirroring a buy BLOCK order from Bittrex to BlockDX, it should place a buy BLOCK order on BlockDX of the same quantity of the order on Bittrex which is being mirrored. In the case of mirroring a buy BLOCK order from Pangolin to BlockDX, the price slippage on Pangolin (or Uniswap), which is a function of the order quantity, needs to be factored in to the decision of where to set the bid price of the buy BLOCK order on BlockDX.

Update 16 Jan: It will really be best if 4 example strategies are written:

  1. An arbitrage strategy between BlockDX and Bittrex (which already exists in tryou's code)
  2. An arbitrage strategy between BlockDX and Pangolin (This will be slightly different from Bittrex arbitrage because Pangolin is an AMM exchange, so price slippage as a function of trade size needs to be factored in.)
  3. An order mirroring strategy between BlockDX and Bittrex.
  4. An order mirroring strategy between BlockDX and Pangolin (This will be slightly different from Bittrex order mirroring because Pangolin is an AMM exchange, so price slippage as a function of trade size needs to be factored in.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions