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

[amibroker] Scale out affects initial positionssize



PureBytes Links

Trading Reference Links

hello,

i have some troubles with scale out. I have defined some rules to 
scale out and basically the code works. However it also affects the 
positionsize at entry. When a trade has any scale out, than the 
positionsize is also reduced. I can't find the reason. Does anyone 
know some possible reasons that i could check ?
This is the part at the end of my code:

PositionSize = -RiskAmount * MarginDeposit / RiskPerContract;
SetPositionSize(ScaleAmount, IIf( Buy == sigScaleOut, 
spsPercentOfPosition, spsNoChange ) );
SetPositionSize(ScaleAmount, IIf( Buy == sigScaleIn, 
spsPercentOfPosition, spsNoChange ) );
SetPositionSize(ScaleAmount, IIf( Short == sigScaleOut, 
spsPercentOfPosition, spsNoChange ) );
SetPositionSize(ScaleAmount, IIf( Short == sigScaleIn, 
spsPercentOfPosition, spsNoChange ) );

and this is the part inside my trading loop:

if(E_USDRdiff[i] == 0.25 AND IRstatus == 0)
{ IRstatus = 0.25; ScaleAmount[i] = 25; Buy[i] = sigScaleOut; }
else if(E_USDRdiff[i] >= 0.50 AND IRstatus == 0)
{ IRstatus = 0.50; ScaleAmount[i] = 50; Buy[i] = sigScaleOut; }
else ScaleAmount[i] = 0;

Regards
Thomas



Please note that this group is for discussion between users only.

To get 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
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/