Kucoin / kucoin-futures-python-sdk

MIT License
7 stars 3 forks source link

Which topic / price to monitor for stoploss on futures? #29

Closed captainreptile closed 2 years ago

captainreptile commented 2 years ago

I am developing a stop-loss script for futures and i'm not sure which topic and price would suit best to monitor (trading wise):

{
    "subject": "tickerV2",
    "topic": "/contractMarket/tickerV2:XBTUSDM",
    "data": {
      "symbol": "XBTUSDM",              
      "bestBidSize": 795,              
      "bestBidPrice": 3200.00,          <-- Watch this incase position is SELL?
      "bestAskPrice": 3600.00,         <-- Watch this incase position is BUY?
      "bestAskSize": 284,               
      "ts": 1553846081210004941         
   }
  }       

Or use:

  { 
    "topic": "/contract/instrument:XBTUSDM",
    "subject": "mark.index.price",
    "data": {
        "granularity": 1000,           
        "indexPrice": 4000.23,            
        "markPrice": 4010.52,           <==== Watch This price (though sometimes the actual market price is higher)
        "timestamp": 1551770400000
    }
  }

Thanks

captainreptile commented 2 years ago

OK seems its better to use the tickerV2, markPrice doesnt update that often and it has slight diffrece