Hi guys,
I face with this problem that i used both PowerPlay condition and "Account Margin" to decide Open 100% position or 50% of position when the condition is not met.
When i used spsPercentOfEquity in SetPositionSize, PowerPlay is still working but Account Margin is not working.
While i used "spsPercentOfPosition" in SetPositionSize, Account Margin is working but PowerPlay Condition is not working.
Can SomeOne know to solve this problem or other way to use both PowerPlay Condition and Account Margin in Position Size like below Code?
Thanks for reading!
RSICrossup = Cross(RSI(),30);
RSICrossDn = Cross( 70,RSI());
PowerPlay_Short = ShortCond1 AND RSICrossDn;
PowerPlay_Long = BuyCond1 AND RSICrossUp;
PowerPlay = IIf( PowerPlay_Short OR PowerPlay_Long,1,2);
Pos_powerplay = 100/PowerPlay;
Buy = Buy_Cond1;
Sell = Sell_cond1;
Short = Short_cond1;
Cover = Cover_cond1;
SetOption("FuturesMode", True);
SetOption("InitialEquity", 10000);
SetOption("AccountMargin", 10 );
//SetOption("MaxOpenPositions", Pos_powerplay );
PositionSize = -Pos_powerplay ;
//SetPositionSize( -100, spsPercentOfPosition );
//SetPositionSize(100/PowerPlay, spsPercentOfEquity );