I'm missing how to code a very simple idea...basically I need to have different
buy/sell rules according to different market regimes (for instance Bull and
Bear markets).
I tried somethink like the below code but it doesn't work since if/else
statements require array subscript and therefore for cycle which I'd like to
avoid.
if ( C > MA(C, 200) ) //Bull Market
{
Buy = ...myBullBuyCond;
Sell = ...myBullSellCond;
Short = ...myBullShortCond;
Cover = ...myBullCoverCond;
}
else //Bear Market
{
Buy = ...myBearBuyCond;
Sell = ...myBearSellCond;
Short = ...myBearShortCond;
Cover = ...myBearCoverCond;
}
Any hints is appreciated,
Paolo