fandrei / AppMetrics

Apache License 2.0
8 stars 2 forks source link

Run away trade placing #122

Closed mrdavidlaing closed 11 years ago

mrdavidlaing commented 11 years ago

In the early hours of Oct 10th, the Ireland PPE monitor placed over 1000 trades in a short period of time, rather than the 2 trades / minute that is was suppost to place.

Why?

At the same time, the ListOpenPositions service was slow:

fandrei commented 11 years ago

Re: [AppMetrics] Run away trade placing (#122) Hello David, This was a method that tries to close all currently open positions. Log shows it made a lot of attempts to execute Trade (this must be due to big count of open positions),  all resulting with error message: Red Card: Price tolerance exceeded Best wishes,  Andrei Faber Wednesday, October 10, 2012, 11:42:43 PM, you wrote: In the early hours of Oct 10th, the Ireland PPE monitor placed over 1000 trades in a short period of time, rather than the 2 trades / minute that is was suppost to place. Why?— Reply to this email directly or view it on GitHub. 

mrdavidlaing commented 11 years ago

Looks like its happening in PROD too:

Kinda violates our "2 trades / min" self throttling :)

Can we:

  1. Prevent the Red Card
  2. Close all the open positions in one request
fandrei commented 11 years ago

I have no idea how to avoid this particular error. I'm requesting price and making new trade immediately. Must be something on the server side.

Closing all positions in one request is a good idea. Multiple open positions still will remain open, but at least it won't make series of unsuccessful attempts to close positions. Working on this.

fandrei commented 11 years ago

Closing all positions in one request - done.