Hi, Guys,
I'm running out of every thing trying to make a ScaleIn and ScaleOut system working. And I'm here to ask you for help.
Here is what I'm trying to achieve:
-
I got a trading system with 2 different buy signals and 2 different sell signals.
-
For scaleIn:
I need to scaleIn 50% of my equity each buy signal. That means I'll buy 50% at buy signal1 and buy another 50% at buy signal2. If 2 buy signals are triggered( at different bar or at the same bar) the position will be 100%.
- For scaleOut:
If the position is 50% (just one buy signal1 triggered) I’ll just sell it at sell signal1, and if the position is 100% (both 2 buy signals triggered) I’ll scaleOut, each sell signal 50% (Selling 100% if both 2 sell signals triggered at the same bar) .
Thank you for your help.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Post my code here:
SetOption( "initialequity", 10000);
SetOption( "AccountMargin", 100);
MaxPos = 2;
SetOption( "MaxOpenPositions", MaxPos );
SetPositionSize( 50, spsPercentOfEquity);
FastMA = MA(C, 5);
SlowMA1 = MA(C, 20);
SlowMA2 = MA(C, 40));
BuySig1 = Cross(FMA, SlowMA1);
BuySig2 = Cross(FMA, SlowMA2);
SellSig1 = Cross(SlowMA1, FMA);
SellSig2 = Cross(SlowMA2, FMA);