bitrinjani/r2

MaxTargetVolumePercentが適用されるタイミングがなぜMainLimitCheckerで行われるなのか?

Opened this issue · 0 comments

お疲れ様です。
最近MaxTargetVolumePercentが使われているタイミングについて質問があります。
下記ログの通りMainLimitCheckerで取引数量が取引可能数量のMaxTargetVolumePercent%内であるかを判断して、オープンするかを判定していると思います。
ただ、個人的に思うのが、なぜ取引数量を決定するタイミングでこのMaxTargetVolumePercentを考慮しないのでしょうか?
下記ログの場合ですとAvailable volumeが0.03 btcであり、MaxTargetVolumePercentが20.0ならば、Target volumeOppotunitySearcherの部分で0.006 btcとするようにしたほうが、効率的に裁定できると思っています。

2018-05-10 17:04:59.708 INFO [OppotunitySearcher] Best ask : Bitbankcc Ask 1,015,900 0.659
2018-05-10 17:04:59.708 INFO [OppotunitySearcher] Best bid : Quoine Bid 1,019,100 0.03
2018-05-10 17:04:59.709 INFO [OppotunitySearcher] Spread : -3200
2018-05-10 17:04:59.709 INFO [OppotunitySearcher] Available volume : 0.03
2018-05-10 17:04:59.709 INFO [OppotunitySearcher] Target volume : 0.01
2018-05-10 17:04:59.709 INFO [OppotunitySearcher] Expected profit : 32 (0.314%)
2018-05-10 17:04:59.709 DEBUG [MainLimitChecker] MaxNetExposureLimit passed
2018-05-10 17:04:59.709 DEBUG [MainLimitChecker] InvertedSpreadLimit passed
2018-05-10 17:04:59.709 DEBUG [MainLimitChecker] MinTargetProfitLimit passed
2018-05-10 17:04:59.709 DEBUG [MainLimitChecker] MaxTargetProfitLimit passed
2018-05-10 17:04:59.709 DEBUG [MainLimitChecker] MaxTargetVolumeLimit violated

config.json

$ cat workspace/r2_all/r2/config.json
{
  "language": "en",
  "demoMode": false,
  "symbol": "BTC/JPY",
  "priceMergeSize": 1000,
  "maxSize": 0.01,
  "minSize": 0.001,
  "minTargetProfitPercent": 0.20,
  "exitNetProfitRatio": 80,
  "maxTargetVolumePercent": 10.0,
  "acceptablePriceRange": 0.1,
  "iterationInterval": 5000,
  "positionRefreshInterval": 5000,
  "sleepAfterSend": 5000,
  "maxNetExposure": 0.1,
  "maxRetryCount": 10,
  "orderStatusCheckInterval": 3000,
  "stabilityTracker": {
    "threshold": 7,
    "recoveryInterval": 120000
  },
  "onSingleLeg": {
    "action": "Reverse",
    "actionOnExit": "Proceed",
    "options": {
      "limitMovePercent": 10,
      "ttl": 10000
    }
  },
  "analytics": {
    "enabled": false,
    "plugin": "SimpleSpreadStatHandler.js",
    "initialHistory": { "minutes": 30 }
  },
  "brokers": [
    {
      "broker": "Coincheck",
      "enabled": false,
      "maxLongPosition": 0.15,
      "maxShortPosition": 0.15,
      "cashMarginType": "NetOut",
      "commissionPercent": 0
    },
    {
      "broker": "Bitflyer",
      "enabled": false,
      "maxLongPosition": 0.04,
      "maxShortPosition": 0,
      "cashMarginType": "Cash",
      "commissionPercent": 0,
      "noTradePeriods": [["04:00", "04:15"]]
    },
    {
      "broker": "Quoine",
      "enabled": true,
      "maxLongPosition": 0.04,
      "maxShortPosition": 0.04,
      "cashMarginType": "NetOut",
      "leverageLevel": 2,
      "commissionPercent": 0
    },
    {
      "broker": "Bitbankcc",
      "npmPath": "@bitr/bitbankcc",
      "enabled": true,
      "maxLongPosition": 0.03,
      "maxShortPosition": 0,
      "cashMarginType": "Cash",
      "commissionPercent": 0
    },
    {
      "broker": "Btcbox",
      "npmPath": "@bitr/btcbox",
      "enabled": true,
      "maxLongPosition": 0.04,
      "maxShortPosition": 0,
      "cashMarginType": "Cash",
      "commissionPercent": 0
    }
  ],
}