Scale-out of futures problem

Hi all, I would like to divide my exit into three stages, each time exiting 33% of the original full position, but dynamically depending on how many contracts I have bought.

For example, if I have bought 30 contracts, then for each time I will exit 10 contracts.

However, if I add the code:

SetPositionSize( 33 , spsPercentOfPosition * ( Short == sigScaleOut ) );

It seems that it will exit 33% of my 66% remaining position (6 or 7 contracts instead of 10 contracts), which is less that what I hope for at the second exit. I read that spsNoChange might help but I could not make it work. Would somebody able to give a hint?

Thank you.

See Scale in/out example.

SetPositionSize( 100, spsPercentOfEquity );
SetPositionSize( 50, spsPercentOfPosition * ( Short == sigScaleOut ) ); // Scale out 50% of position

If using non-zero Trade Delays with scaling in/out then add:

PositionSize = Ref( PositionSize, -1 ); // If using non-zero Trade Delays with scaling in/out

Or use Buy = Ref(Buy, -1) method.

1 Like

Sorry, I am not quite understand why this will divide my trades into 3 exits and each with a fixed trade sizes. I tried to read the documentation but it seems do not mention any related function.

Modify the above example code to suit your own rules.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.