lugnitdgp / freemex

Online stock market game
13 stars 22 forks source link

App showing incorrect cash balance when traded off market hours #28

Open agrawalo opened 5 years ago

agrawalo commented 5 years ago

I have created an account and it shows that I have $500000 to trade. I bought 100 stocks of FB (note that the market is closed).

  1. It allowed me to make this transaction. I think it shouldn't allow when the market is closed.
  2. It allowed and my cash balance is not adjusted, i.e. I still have $500000 as cash balance.

Transactions Cash in your hand: $500000.00

Stock name | Status | Quantity | Stock code | Price | Gain/loss Alphabet Inc Class C | BOUGHT | 50 | GOOG | $0.00 | $0.00

ghoshbishakh commented 5 years ago

This is because price for alphabet was not updated. You need to configure proper API keys and then test the app.

agrawalo commented 5 years ago

How do I do that?

ghoshbishakh commented 5 years ago

We used an API to fetch quotes.. that has changed now. It requires authentication (to the best of my knowledge). You have to modify this function with a new API / proper authentication.. https://github.com/lugnitdgp/freemex/blob/master/core/utils.py#L14

agrawalo commented 5 years ago

Any suggestion on which API to use?

ankan17 commented 5 years ago

@agarwalo The API has been updated. This should be fixed now.