You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Therefore there are 4 possible varieties of SmartTrade:
Buy
Sell
Order
Order
Order
Ladder
Ladder
Order
Ladder
Ladder
Need to create a package for processing every type and variety of SmartTrade. The API may be something like this:
SmartTrade
constentity=prisma.smartTrade.findUnique({where: {id: 1}})constsmartTrade=newSmartTradeProcessor(entity)// must cancel all open orders and mark SmartTrade as closedawaitsmartTrade.cancel()// place the entry order (entryType == "Order")// or the first order of ladder (entryType == "Ladder")awaitsmartTrade.entry()// OR using hooks// e.g. using WebSockets and receiving events from the exchangeawaitsmartTrade.handleOrderFilled(orderId)// the processor will decide by itself what to do with that eventawaitsmartTrade.handleOrderCanceled(orderId)// @internal// place the next entry buy order if needed (entryType === "Ladder")// place TP sell order if entry buy order was filled (entryType === "Order")awaitsmartTrade.publishNext()
DCA
constentity=prisma.smartTrade.findUnique({where: {id: 2}})constdca=newDCATradeProcessor(entity)awaitdca.cancel()// same as for SmartTradeawaitdca.entry()// same as for SmartTrade// if TP was filled, then mark DCA as completed// if SO (Safety Order) was filled, then it must update the TP order limit price// if SL was filled, the mark DCA as completedawaitdca.handleOrderFilled(orderId)// @internalawaitdca.updateTakeProfit()
The text was updated successfully, but these errors were encountered:
Currently we have two types of SmartTrades:
Entry and TakeProfit may be Order or Ladder.
Therefore there are 4 possible varieties of SmartTrade:
Need to create a package for processing every type and variety of SmartTrade. The API may be something like this:
SmartTrade
DCA
The text was updated successfully, but these errors were encountered: