kirkthaker / investopedia-trading-api

An api, written in Python, for Investopedia's paper trading stock simulator.
Other
220 stars 61 forks source link

added option trading #14

Closed stellarore closed 7 years ago

stellarore commented 7 years ago

Not sure why GitHub thinks I changed the whole file. Probably in how I updated my fork with your repo. I only added the function trade_option

Examples: client.trade_option("GOOG", Action.buy, "Call", 945, 170616, 1) client.trade_option("GOOG", Action.buy, "Put", 932.50, 170616, 10, "Limit", 6.25) client.trade_option(symbol, ordertype, optiontype, strikeprice, expire_date, quantity, pricetype, targetprice, duration)

Successfully tested option orders with limits, stops, Duration.day_order. Raises exception on error like with client.trade().

Date currently gets entered as YYMMDD (ex. "170616" for 2017-06-16). not sure if good idea.

stellarore commented 7 years ago

I blame my portfolio's poor performance on testing this API. image

kirkthaker commented 7 years ago

I've bought so many random stocks just to test it as well lol. I'll take a look at your pull request and probably merge over the weekend. Thanks for helping.

kirkthaker commented 7 years ago

Reviewing & making changes in branch options

yoloVoe commented 7 years ago

@kirkthaker If you are done testing, you should consider merging.

kirkthaker commented 7 years ago

Sorry, this totally slipped my mind! Thanks for helping out