USOil was entered into however 870 contracts were bought at 38.50 instead of 87. I had changed the .dta file to account for this but I assume the .dta carrying the margin value is overwritten every time a broker connection is made. So the incorrect margin value must have been reset.

That aside, I am struggling to work out why the position was closed out immediately. There is no stop set in the script Im running.

Edit: It was closed out due to margin call. The position size is 10x larger than what it should be.

The mystery solved.

When Zorro is connected to a broker, it loads the current spread and rollover values from the broker's server. When not connected, the spread and rollover values are loaded from the History\AssetsFix.dta file or from the parameter file given by AssetList.

So I need to set the margin for oil in the script.


[USOil::L1830] -696$ s0.00000 c38.49 e38.50


[197: Thu 10.03.16 00:05] 112.605
[198: Fri 11.03.16 00:05] 113.290
(AUD/USD::L) Long 0@0.7529 Entry stop
(CHF/JPY::S) Short 26@111.90 Entry stop
(EUR/JPY::S) Short 123@122.08 Entry stop
(USOil::L) Long 87@38.50 Entry stop
(USOil::L) Entry stop 38.50 hit at 03:32
[USOil::L1830] Long 87@38.50

[USOil::L1830] -696$ s0.00000 c38.49 e38.50


Last edited by RTG; 03/11/16 15:00.