stock/commodity market micro economic simulation made in processing

Hello, I hope to get into the swing of uploading semi-regularly to youtube and this forum, as I haven't posted in a while. in the last year and a half I have gained an interest in quantitative finance and algorithmic trading (having computer algorithm trade for you rather than doing so yourself) and have made something of a part time job out of it. I created a backtesting framework in processing which I plan to share in the future but was wanting to backtest market making (buying and selling simultaneously with a small differential in order to make a profit) strategies, however this can affect the outcome of the market as you are engaged in a large share of volume. So in order to overcome this pitfall, I have created a model that engages 2000 buyers and 2000 sellers trading back and fourth, some waiting for others to buy from them, others seeking out sellers/buyers. This ratio can be adjusted via the liquidity dial. There is also a supply and demand dial, as well as market depth visualization allowing you to see the trading real time! I created a video showcasing this on my youtube, the source code is available as well for any interested in modifying the program. Please share your changes and I will showcase them on my channel!

Source: http://pastebin.com/dMLrSiaN PS : You need to install the controlP5 library for GUI to run this sketch!!!

Video:

Comments

  • Its worth depends on the accuracy of your model, but still a nice simulation.

  • Its worth depends on the accuracy of your model, but still a nice simulation.

    Very true, i'm yet to still test my model however. And thanks, glad you enjoyed it.

  • edited April 2016

    Dude, this is super cool. B-)

    Checking out the limits, I crashed it with D(10), S(5), L(0.05). Goes through the roof. hehe
    Two unused variables. Line 68: int m. Line 118: float Size.

    Code is nice and clean. Could possibly use some comments in the if trees for us dumb people. :D

  • Checking out the limits, I crashed it with D(10), S(5), L(0.05). Goes through the roof. hehe Two unused variables. Line 68: int m. Line 118: float Size.

    Haha glad to see you enjoyed it, been working on a backtesting framework, once I get more time i plan to release it.

Sign In or Register to comment.