キャンセル時にProfitがNaNになる
Opened this issue · 0 comments
winor30 commented
お疲れ様です。
大変素晴らしいシステムを開発していただいてありがとうございます。
ただ、利用させていただいてキャンセル時の挙動で気になるところがあります。
下記ログをの通り、キャンセルするときにProfit is NaN
と出てしまうのは意図したとおりでしょうか?
キャンセル時もクローズ時のキャンセルもProceedにしていれば一応Proftはでると思うので、なぜ、NaNにしてしまうのかなと思い質問させて頂きました。
# log
2018-05-12 22:21:59.784 INFO [PairTrader] >>Sending order targetting quote Btcbox Ask 938,000 0.099...
2018-05-12 22:21:59.784 INFO [PairTrader] >>Sending order targetting quote Quoine Bid 937,700 2.61...
2018-05-12 22:22:03.111 INFO [PairTrader] >>Order check attempt 1.
2018-05-12 22:22:03.111 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:03.197 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:03.197 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:06.199 INFO [PairTrader] >>Order check attempt 2.
2018-05-12 22:22:06.199 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:06.265 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:06.265 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:09.269 INFO [PairTrader] >>Order check attempt 3.
2018-05-12 22:22:09.269 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:09.359 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:09.359 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:12.360 INFO [PairTrader] >>Order check attempt 4.
2018-05-12 22:22:12.360 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:12.492 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:12.492 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:15.493 INFO [PairTrader] >>Order check attempt 5.
2018-05-12 22:22:15.493 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:15.579 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:15.579 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:18.583 INFO [PairTrader] >>Order check attempt 6.
2018-05-12 22:22:18.583 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:18.676 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:18.677 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:21.678 INFO [PairTrader] >>Order check attempt 7.
2018-05-12 22:22:21.678 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:21.770 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:21.770 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:24.770 INFO [PairTrader] >>Order check attempt 8.
2018-05-12 22:22:24.771 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:24.853 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:24.854 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:27.857 INFO [PairTrader] >>Order check attempt 9.
2018-05-12 22:22:27.857 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:27.963 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:27.964 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:30.965 INFO [PairTrader] >>Order check attempt 10.
2018-05-12 22:22:30.965 INFO [PairTrader] >>Checking if both legs are done or not...
2018-05-12 22:22:31.055 WARN [PairTrader] >>Pending: Btcbox Buy 0.005 BTC sent at 938,938, pending size 0.005 BTC
2018-05-12 22:22:31.055 INFO [PairTrader] >>Filled: Quoine Sell 0.005 BTC filled at 937,787
2018-05-12 22:22:31.055 WARN [PairTrader] Max retry count reached. Cancelling the pending orders.
2018-05-12 22:22:31.130 INFO [SingleLegHandler] >>Trying to execute the unfilled leg Btcbox Buy 0.005 BTC at new price 1,032,832, size 0.005 BTC
2018-05-12 22:22:31.131 INFO [SingleLegHandler] >>Sending an order with TTL 10000 ms...
2018-05-12 22:22:41.280 INFO [SingleLegHandler] >>Filled: Btcbox Buy 0.005 BTC filled at 1,032,832
2018-05-12 22:22:41.283 INFO [PairTrader] >>Profit is NaN.
2018-05-12 22:22:41.283 INFO [PairTrader] >>Commission is NaN.
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
}
],
}