-
-
Save thash/38ecf25ca81128416054 to your computer and use it in GitHub Desktop.
SBI証券, MONEX, カブコム 現物株売買手数料比較
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://site1.sbisec.co.jp/ETGate/WPLETmgR001Control?OutSide=on&getFlg=on&burl=search_home&cat1=home&cat2=price&dir=price&file=home_price.html | |
| sbi = { | |
| 0..10 => 150, | |
| 10..20 => 199, | |
| 20..50 => 293, | |
| 50..100 => 525, | |
| 100..150 => 628, | |
| 150..3000 => 994, | |
| 3000..Float::INFINITY => 1050 | |
| } | |
| # http://www.monex.co.jp/ServiceInformation/00000000/guest/G100/srv/srv05.htm | |
| # 50万以上は, 成行の場合手数料が2/3になる. | |
| monex = { | |
| 0..10 => 108, | |
| 10..20 => 194.4, | |
| 20..30 => 270, | |
| 30..40 => 378, | |
| 40..50 => 486, | |
| 50..100 => 1500, | |
| 100..Float::INFINITY => -> (n) { n * 0.0015 * 10000 } # 万円 -> 円 | |
| } | |
| # http://kabu.com/item/stock/cost.html | |
| kabu = { | |
| 0..5 => 146, | |
| 5..15 => 243, | |
| 15..25 => 340, | |
| 25..55 => 632, | |
| 55..100 => 1069, | |
| 100..200 => 2041, | |
| 200..Float::INFINITY => 3985 | |
| } | |
| tests = [1, 5, 10, 20, 50, 100, 200, 500, 1000] | |
| def a(n, ranges) | |
| t = ranges.select{|k,v| k.include?(n+1) }.values.first | |
| t.is_a?(Proc) ? t.call(n) : t | |
| end | |
| [sbi, monex, kabu].each do |sec| | |
| p tests.map{|n| a(n, sec)} | |
| end | |
| # => [150, 150, 199, 293, 525, 628, 994, 994, 994] | |
| # => [108, 108, 194.4, 270, 1500, 1500.0, 3000.0, 7500.0, 15000.0] | |
| # => [146, 243, 243, 340, 632, 2041, 3985, 3985, 3985] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment