PureBytes Links
Trading Reference Links
|
gabriel_id@xxxxxxxxx wrote:
@Aron,
can u tell me.. why its -1 at MarginDeposit ?
-1 its equivalent with 1% margin ?
Thx
Yes, negative sign means percent, but it looks like it works only if
you set your position size in units:
SetPositionSize(
10000, spsShares );
// 10,000 EUR
MarginDeposit = -1;
MarginDeposit used to be a scalar not an array so you could not chage
it per trade basis.
Some times ago in a reply in the feedback centre regarding
margindeposit Tomasz anounced that from that moment on margin deposit
would be an array
so you could do stuff like:
lotsize = 100000;
leverage = 100;
PointValue = lotsize;
MarginDeposit = Close * lotsize / leverage;
But I'm not sure why it still does not change per trade bases.
The best solution I found is setting it through custom backtester:
SetCustomBacktestProc("");
if ( Status( "action" ) == actionPortfolio )
{
bo = GetBacktesterObject();
bo.PreProcess();
for
( bar = 0;
bar < BarCount; bar++ )
{
for ( sig = bo.GetFirstSignal(bar); sig; sig =
bo.GetNextSignal(bar) )
{
if(sig.isEntry())
{
sig.pointvalue = 10000;
// 10,000 lotsize
sig.margindeposit = sig.pointvalue * sig.price / 100;
// leverage 1:100
}
}
bo.ProcessTradeSignals( bar );
}
bo.PostProcess();
}
__._,_.___
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
*********************************
__,_._,___
|
|