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