Skip to content

Commit

Permalink
status -> new_status
Browse files Browse the repository at this point in the history
  • Loading branch information
seii-saintway committed Jan 27, 2021
1 parent c3c1cbe commit 5c4e48f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions graph/main-martingale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"TRADE_UNIT = 0.0001\n",
"INIT_BUY_JPY = 5000\n",
"INIT_SELL_JPY = 5000\n",
"MAX_TRADED_JPY = 520000\n",
"MAX_TRADED_JPY = 350000\n",
"\n",
"TRADABLE_UNIT_CC_GAIN_JPY = 5000 # TODO: self-adaptive by trend analysis\n",
"TRADABLE_UNIT_CC_LOSS_JPY = 25000\n",
"TRADABLE_UNIT_CC_GAIN_JPY = 25000 # TODO: self-adaptive by trend analysis\n",
"TRADABLE_UNIT_CC_LOSS_JPY = 125000\n",
"\n",
"MIN_UNIT_CC_INIT_TRADE_JPY = 20000\n",
"MIN_UNIT_CC_INIT_TRADE_JPY = 10000\n",
"MAX_UNIT_CC_INIT_TRADE_JPY = MIN_UNIT_CC_INIT_TRADE_JPY << 10\n",
"MAX_UNIT_CC_LOSS_JPY = MAX_UNIT_CC_INIT_TRADE_JPY\n",
"\n",
Expand Down Expand Up @@ -188,7 +188,7 @@
" self.sold_unit_amount += sell_unit_amount\n",
" self.got_fiat_money += sell_fiat_price * (self.trade_unit * sell_unit_amount)\n",
" self.trim_sold_status()\n",
" \n",
"\n",
" def trim_trade_status(self):\n",
" self.trim_bought_status()\n",
" self.trim_sold_status()\n",
Expand Down Expand Up @@ -368,9 +368,9 @@
" new_percentage = new_status.get_usage() * 100\n",
"\n",
" self.last_transaction = (\n",
" f'GAINED {gained_fiat_money:+.2f} JPY: GAINED {new_status.total_gained_fiat_money:+.2f} JPY in total at {datetime.now()}\\n'\n",
" f'SOLD {amount:.4f} = +{old_amount:.4f} ({old_percentage:.2f}%) -{new_amount:.4f} ({new_percentage:.2f}%) ETH'\n",
" f' for {diff_price:.2f} = {fiat_price:.2f} - {old_avg_price:.2f} JPY/ETH: NO.{new_status.trade_count + 1}-{new_status.sell_count}\\n'\n",
" f'GAINED {gained_fiat_money:+.2f} JPY: GAINED {new_status.total_gained_fiat_money:+.2f} JPY in total at {datetime.now()}\\n'\n",
" )\n",
"\n",
" self.fth.write(self.last_transaction)\n",
Expand Down Expand Up @@ -515,7 +515,7 @@
" send_slack(\n",
" f'{bookkeeper.last_transaction}'\n",
" f'BY {new_status.get_robot_title()}',\n",
" 'Power by https://jhub.name/', 'good' if status.total_gained_fiat_money > 0 else 'danger'\n",
" 'Power by https://jhub.name/', 'good' if new_status.total_gained_fiat_money > 0 else 'danger'\n",
" )\n",
"\n",
" status.update( status = new_status )\n",
Expand Down

0 comments on commit 5c4e48f

Please sign in to comment.