|
6 | 6 | require 'bitflyer/cli/command/order_by_twap_command' |
7 | 7 | require 'bitflyer/cli/command/stop_by_range_command' |
8 | 8 | require 'bitflyer/cli/command/summary_command' |
| 9 | +require 'bitflyer/cli/version' |
9 | 10 |
|
10 | 11 | module Bitflyer |
11 | | - class CLI < Thor |
12 | | - desc 'cancel_all', 'cancel all of orders' |
13 | | - def cancel_all |
14 | | - CancelAllCommand.new.run |
15 | | - end |
| 12 | + module Cli |
| 13 | + class Runner < Thor |
| 14 | + desc 'cancel_all', 'cancel all of orders' |
| 15 | + def cancel_all |
| 16 | + CancelAllCommand.new.run |
| 17 | + end |
16 | 18 |
|
17 | | - desc 'counter_trade', 'clear all positions' |
18 | | - def counter_trade |
19 | | - CounterTradeCommand.new.run |
20 | | - end |
| 19 | + desc 'counter_trade', 'clear all positions' |
| 20 | + def counter_trade |
| 21 | + CounterTradeCommand.new.run |
| 22 | + end |
21 | 23 |
|
22 | | - desc 'order_by_best', 'create limit order by best price in the board' |
23 | | - method_option :amount, aliases: 'a', type: :numeric, banner: 'amount', required: true |
24 | | - method_option :type, aliases: 't', type: :string, banner: 'buy/sell', required: true |
25 | | - def order_by_best |
26 | | - OrderByBestCommand.new.run(options) |
27 | | - end |
| 24 | + desc 'order_by_best', 'create limit order by best price in the board' |
| 25 | + method_option :amount, aliases: 'a', type: :numeric, banner: 'amount', required: true |
| 26 | + method_option :type, aliases: 't', type: :string, banner: 'buy/sell', required: true |
| 27 | + def order_by_best |
| 28 | + OrderByBestCommand.new.run(options) |
| 29 | + end |
28 | 30 |
|
29 | | - desc 'order_by_twap', 'order by using TWAP algorithm' |
30 | | - method_option :amount, aliases: 'a', type: :numeric, banner: 'amount', required: true |
31 | | - method_option :type, aliases: 't', type: :string, banner: 'buy/sell', required: true |
32 | | - method_option :number_of_times, aliases: 'n', type: :numeric, banner: 'N', required: true |
33 | | - method_option :interval, aliases: 'i', type: :numeric, banner: 'second', required: true |
34 | | - def order_by_twap |
35 | | - OrderByTWAPCommand.new.run(options) |
36 | | - end |
| 31 | + desc 'order_by_twap', 'order by using TWAP algorithm' |
| 32 | + method_option :amount, aliases: 'a', type: :numeric, banner: 'amount', required: true |
| 33 | + method_option :type, aliases: 't', type: :string, banner: 'buy/sell', required: true |
| 34 | + method_option :number_of_times, aliases: 'n', type: :numeric, banner: 'N', required: true |
| 35 | + method_option :interval, aliases: 'i', type: :numeric, banner: 'second', required: true |
| 36 | + def order_by_twap |
| 37 | + OrderByTWAPCommand.new.run(options) |
| 38 | + end |
37 | 39 |
|
38 | | - desc 'stop_by_range', 'create stop order by range based on current position' |
39 | | - method_option :range, aliases: 'r', type: :numeric, banner: 'price range', required: true |
40 | | - def stop_by_range |
41 | | - StopByRangeCommand.new.run(options) |
42 | | - end |
| 40 | + desc 'stop_by_range', 'create stop order by range based on current position' |
| 41 | + method_option :range, aliases: 'r', type: :numeric, banner: 'price range', required: true |
| 42 | + def stop_by_range |
| 43 | + StopByRangeCommand.new.run(options) |
| 44 | + end |
43 | 45 |
|
44 | | - desc 'ifdoco_by_range', 'create IFDOCO order by range based on current price' |
45 | | - method_option :amount, aliases: 'a', type: :numeric, banner: 'amount', required: true |
46 | | - method_option :type, aliases: 't', type: :string, banner: 'buy/sell', required: true |
47 | | - method_option :range, aliases: 'r', type: :numeric, banner: 'price range', required: true |
48 | | - method_option :percentage, aliases: 'p', type: :numeric, banner: 'price ratio percentage', required: true |
49 | | - def ifdoco_by_range |
50 | | - IFDOCOByRangeCommand.new.run(options) |
51 | | - end |
| 46 | + desc 'ifdoco_by_range', 'create IFDOCO order by range based on current price' |
| 47 | + method_option :amount, aliases: 'a', type: :numeric, banner: 'amount', required: true |
| 48 | + method_option :type, aliases: 't', type: :string, banner: 'buy/sell', required: true |
| 49 | + method_option :range, aliases: 'r', type: :numeric, banner: 'price range', required: true |
| 50 | + method_option :percentage, aliases: 'p', type: :numeric, banner: 'price ratio percentage', required: true |
| 51 | + def ifdoco_by_range |
| 52 | + IFDOCOByRangeCommand.new.run(options) |
| 53 | + end |
52 | 54 |
|
53 | | - desc 'summary', 'show current balance information' |
54 | | - def summary |
55 | | - SummaryCommand.new.run |
| 55 | + desc 'summary', 'show current balance information' |
| 56 | + def summary |
| 57 | + SummaryCommand.new.run |
| 58 | + end |
56 | 59 | end |
57 | 60 | end |
58 | 61 | end |
0 commit comments