Module: Schwab::Operations::Support::BuildWatchlistItems

Defined in:
lib/schwab/operations/support/build_watchlist_items.rb

Instance Method Summary collapse

Instance Method Details

#build_watchlist_items(symbol_list) ⇒ Object

This gem only supports EQUITY type, even though there is a lot more you can do with the API



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/schwab/operations/support/build_watchlist_items.rb', line 6

def build_watchlist_items(symbol_list)
  symbol_list.map do |symbol|
    {
      "quantity": 0,
      "averagePrice": 0,
      "commission": 0,
      "purchasedDate": (Date.today).strftime('%Y-%m-%d'),
      "instrument": {
        "symbol": symbol,
        "assetType": "EQUITY"
      }
    }
  end
end