It seems like 'margin call' does not work properly.
MarkWhatson last edited by
I'm implementing many different strategies and one of them is allowed to have short positions.
I set my initial cash with $ 100,000 and my cerebro trades as below
2019-04-03 SELL EXECUTED on BTC: Price: 4916.470000, Cost: -90001.464489, Comm 90.001464
and stays until the end of Aug. 2019. where the period between them was a 'bull market'.
Therefore, to my knowledge, I should have lost all money (about $90,000) since the price on BTC goes higher, more than twice of the initial price where the position should be 'forced liquidation' or 'margin call'.
So I expected that my final portfolio value from cerebro.broker.getvalue() should be 100,000 - 90,001.464489, which is about 10,000. However, it shows that my value as $5,093, and I couldn't understand what's happening inside of the cerebro.
Is there any process to handle this kind of situation or what happened if my position should be sold by force?
To me it would seem your code does not work properly. But I cannot know, neither can anyone, because there is no code (which would let people understand how you have configured things) and no logs beyond an isolated line (which lacks information such as ...
As far as the story goes, you say you stared with a portfolio value of $100k (all in cash), have made a trade in the wrong direction and the value of your portfolio is $5k. It is what usually happens when one makes a trade in the wrong direction. You can even go negative (in real life ... too)
if my position should be sold by force?
If you are implying that the simulation broker is going to liquidate your positions, I would kindly ask for a pointer to where you have read that will happen. It is not a functionality of the broker.