Tag Info

New answers tagged

1

Only the transactions affect the account. See example implementation below. The position and money should be initialized at the beginning. Note that both of them, and also quantity can be positive and negative. public static class PNL { private double position = 0; // number of BTC private double money = 0.0; // USD public double get_position() ...


1

No. 10 shares from Order1 have time priority. The 100 shares of Order2 will trader after 10 from Order1. The 90 hidden shares of Order1 are hidden, and therefore at the back of the queue. When they light, they get in line at the back.



Top 50 recent answers are included