Skip to content

Instantly share code, notes, and snippets.

@giodamelio
Created September 5, 2011 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giodamelio/1195520 to your computer and use it in GitHub Desktop.
Save giodamelio/1195520 to your computer and use it in GitHub Desktop.
Market sim code
#! /usr/bin/env python
"""
Program or module info
"""
__version__ = "0.1"
__author__ = "Gio d'Amelio(giodamelio@gmail.com)"
__license__ = "Public Domain"
import market as marketsim
def main():
market = marketsim.simulator(100000, debug=True)
print(market.money)
market.buy("GOOG", 100)
market.sell("GOOG", 100)
market.buy("CAKE", 134)
print(market.get_stocks())
print(market.money)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment