StockTrade - dchrostowski/investopedia_simulator_api GitHub Wiki
StockTrade(symbol, quantity, trade_type, order_type, duration, send_email)
Input parameters
symbol
- A string representing a ticker symbol
quantity
- An integer representing number of shares to buy/sell/short/cover
trade_type
- Either a string or TradeType
object. If string, valid values are 'buy', 'sell', 'sell short', or 'buy to cover'
order type
- Either a string or OrderType
object. Defaults to OrderType.MARKET()
duration
- Either a string or Duration
object. Defaults to Duration.GOOD_TILL_CANCELLED()
send_email
- boolean. Defaults to True.
Methods
validate()
- Returns a PreparedTrade object
execute()
- Attempts to execute the trade.