[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Margin Bug?



PureBytes Links

Trading Reference Links

I'm not controlling the margin in code, but with the Settings button 
in the Automatic Analysis window. I think this is a legitimate bug.

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxx> wrote:
>
> If you're controlling the margin with code you need to adjust the
> positionsize too. If margin = 50 then Positionsize = -200
> 
> Some actual code;
> 
> margin = 50; //or use param statement
> SetOption("MarginRequirement",margin);
> leverage = 100/margin; //defines leverage
> PositionSize = PositionSize * leverage;
> --
> Terry
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On
> Behalf Of Chris
> Sent: Saturday, June 10, 2006 20:10
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Margin Bug?
> 
> I have written a script to simulate buy and hold:
> 
> Buy = 1;
> Sell = 0;
> 
> I have tried this script using various account margin settings. 
Using 
> 50% margin the results are as predicted. Using a margin setting >= 
> 56.1, the system does not trade.
> 
> Has anyone else encountered this?