Hi,

I am new to this forum and I am trying to play with Zorro to trade US equities, say SPY. I am able to convert my 1 min csv file into bar file with slight modification to the convert script and I can test a simple sma script by setting the AssetFix to be
Name Price Spread RollLong RollShort PIP PIPCost MarginCost Leverage LotAmount Commission Symbol
SPY 200 0 0 0 0.01 0.01 0 1 1 0

Basically I set the leverage to be 1.

In the test script it is always trading 1 lot which is 1 share. Now I want to workshop 5 money management to reinvest all the profit by setting
Capital = 100000; // reinvestment mode
Margin = 1 * (Capital + ProfitClosed);

The the backtest aborted after the first loss of only $80 as of margin call.

How should I set the AssetsFix file or my reinvest mode to make it and all-in approach to reinvest all the capital for each trade?(only one position open at each time)

Thanks.