My Repo

0 views
Skip to first unread message

Matt

unread,
Feb 22, 2010, 6:50:47 PM2/22/10
to Erlang Colearning
Everyone is probably past this, but here is my repo for the start of
my project.
http://bitbucket.org/mfollett/stocker/

Clone via:
hg clone https://mfol...@bitbucket.org/mfollett/stocker/

~Matt

Matt Follett

unread,
Feb 22, 2010, 9:42:58 PM2/22/10
to erlang-c...@googlegroups.com
I should have mentioned this, first compile the three files, dispatcher, agent, and client. Then, call client.setup_and_start(), this'll initialize the Mnesia database. From there everything happens through dispatcher.dispatcher(), some examples:
dispatcher.dispatch({buy, {equity, "BAC"}, 20, {client, "Matt"}})
dispatcher.dispatch({sell, {equity, "BAC"}, 20, {client, "Matt"}})
dispatcher.dispatch({desposit, 200, {client, "Matt"})
dispatcher.dispatch({withdraw, 200, {client, "Matt"})

You can inspect the Mnesia database by looking at the transaction, bank, and holding tables. However, the holding table does not currently get populated.

Thanks,
Matt Follett

Reply all
Reply to author
Forward
0 new messages