Class: MyTradeWizard::CLI
- Inherits:
-
Thor
- Object
- Thor
- MyTradeWizard::CLI
- Defined in:
- lib/mytradewizard/cli.rb
Instance Method Summary collapse
Instance Method Details
#accounts ⇒ Object
32 33 34 35 36 |
# File 'lib/mytradewizard/cli.rb', line 32 def accounts ib = MyTradeWizard::InteractiveBrokers.new ib.connect puts "Accounts: " + ib.accounts.join(", ") end |
#CL ⇒ Object
39 40 41 42 43 |
# File 'lib/mytradewizard/cli.rb', line 39 def CL ib = MyTradeWizard::InteractiveBrokers.new ib.connect puts "Front month: " + ib.front_month(:CL).expiry end |
#config ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mytradewizard/cli.rb', line 15 def config puts "Environment: " + MyTradeWizard::Configuration::ENVIRONMENT puts "Host: " + MyTradeWizard::Configuration::InteractiveBrokers::HOST puts "Port: " + MyTradeWizard::Configuration::InteractiveBrokers::PORT.to_s puts "Account: " + MyTradeWizard::Configuration::InteractiveBrokers::ACCOUNT puts "Email To: " + MyTradeWizard::Configuration::Email::TO puts "Gmail Username: " + MyTradeWizard::Configuration::Email::GMAIL_USERNAME puts "Gmail Password: " + MyTradeWizard::Configuration::Email::GMAIL_PASSWORD end |
#configure ⇒ Object
10 11 12 |
# File 'lib/mytradewizard/cli.rb', line 10 def configure MyTradeWizard::Generators::MyTradeWizard.start([[:environment] || "local", [:host] || "localhost", [:port] || 7496, [:account] || "", [:email_to] || "", [:gmail_username] || "", [:gmail_password] || ""]) end |
#connect ⇒ Object
26 27 28 29 |
# File 'lib/mytradewizard/cli.rb', line 26 def connect ib = MyTradeWizard::InteractiveBrokers.new ib.connect end |
#QM ⇒ Object
46 47 48 49 50 |
# File 'lib/mytradewizard/cli.rb', line 46 def QM ib = MyTradeWizard::InteractiveBrokers.new ib.connect puts "Front month: " + ib.front_month(:QM).expiry end |