I believe Mike lives ON the server :-) ...he is always very helpful and timely with his hints.
Mike/Steve thanks for your suggestions. Actually nested IIF are the most practical solution. I don't know why I tend to consider them not very efficient and making the code not very easy to read...but they work. Thanks, Paolo --- In [email protected], "Steve Dugas" <sjdu...@...> wrote: > > Mike beat me to it...he must live closer to the server... 8 - ) > > > ----- Original Message ----- > From: "Steve Dugas" <sjdu...@...> > To: <[email protected]> > Sent: Thursday, June 24, 2010 2:49 PM > Subject: Re: [amibroker] Re: buy/sell rules for different market regimes > > > > You could stack them one inside another... > > > > Buy = IIF( BullMkt AND LowVol , LVBullBuyCond, > > IIF( BullMkt AND HighVol, HVBullBuyCond, > > IIF( BearMkt AND LowVol, LVBearBuyCond, HVBearBuyCond ))); > > > > > > ----- Original Message ----- > > From: "Paolo" <pcavat...@...> > > To: <[email protected]> > > Sent: Thursday, June 24, 2010 2:32 PM > > Subject: [amibroker] Re: buy/sell rules for different market regimes > > > > > >> Unfortunately I had already tried that but it doesn't work if market > >> regimes are more than 2 (for instance bull low vol, bull high vol, bear > >> high vol and bear low vol). > >> > >> Thanks for your suggestion anyway, > >> > >> Paolo > >> > >> --- In [email protected], "Steve Dugas" <sjdugas@> wrote: > >>> > >>> Hi - Try this way > >>> > >>> Buy = IIF( C > MA( C, 200 ), BullBuyCond, BearBuyCond ); > >>> Similar for sell, short, cover. > >>> > >>> > >>> ----- Original Message ----- > >>> From: "Paolo" <pcavatore@> > >>> To: <[email protected]> > >>> Sent: Thursday, June 24, 2010 2:07 PM > >>> Subject: [amibroker] buy/sell rules for different market regimes > >>> > >>> > >>> > 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 > >>> > > >>> > > >>> > > >>> > ------------------------------------ > >>> > > >>> > **** IMPORTANT PLEASE READ **** > >>> > This group is for the discussion between users only. > >>> > This is *NOT* technical support channel. > >>> > > >>> > TO GET TECHNICAL SUPPORT send an e-mail directly to > >>> > SUPPORT {at} amibroker.com > >>> > > >>> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > >>> > http://www.amibroker.com/feedback/ > >>> > (submissions sent via other channels won't be considered) > >>> > > >>> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > >>> > http://www.amibroker.com/devlog/ > >>> > > >>> > Yahoo! Groups Links > >>> > > >>> > > >>> > > >>> > > >>> > >> > >> > >> > >> > >> ------------------------------------ > >> > >> **** IMPORTANT PLEASE READ **** > >> This group is for the discussion between users only. > >> This is *NOT* technical support channel. > >> > >> TO GET TECHNICAL SUPPORT send an e-mail directly to > >> SUPPORT {at} amibroker.com > >> > >> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > >> http://www.amibroker.com/feedback/ > >> (submissions sent via other channels won't be considered) > >> > >> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > >> http://www.amibroker.com/devlog/ > >> > >> Yahoo! Groups Links > >> > >> > >> > >> > > > > > > > > > > ------------------------------------ > > > > **** IMPORTANT PLEASE READ **** > > This group is for the discussion between users only. > > This is *NOT* technical support channel. > > > > TO GET TECHNICAL SUPPORT send an e-mail directly to > > SUPPORT {at} amibroker.com > > > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > > http://www.amibroker.com/feedback/ > > (submissions sent via other channels won't be considered) > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > http://www.amibroker.com/devlog/ > > > > Yahoo! Groups Links > > > > > > > > >
