Hi - Close, it is Exrem that removes all signals until opposite signal is generated. Flip, after a True, will continue to return True until it comes to a True in the 2nd array. I think it is convenient to look at it as Signal ( buy, sell, use Exrem ) vs. State ( in long, in short, use Flip ) In your case, if you have 2 arrays...
1101101111000000111 // in buy zone, occasionally drops into neutral territory 0000000000111111000 // in sell zone then after doing InLong = Flip( InBuyZone, InSellZone ); you will have 1101101111000000111 // in buy zone 0000000000111111000 // in sell zone 1111111111000000111 // in long, here is the filter you wanted I think? ----- Original Message ----- From: "levibreidenbach" <lev...@comcast.net> To: <amibroker@yahoogroups.com> Sent: Monday, October 19, 2009 11:15 AM Subject: [amibroker] Re: MA cross with %filter > Hello: > > I'm still having difficulty understanding both the flip() and exrem() > function. Can somebody help to explain them. I've read documentation, > but it is fairly brief. > > Does flip remove all signals until a opposite signal is generated? Not > sure if I'm understanding it. > > Thanks > > Levi > > --- In amibroker@yahoogroups.com, "levibreidenbach" <lev...@...> wrote: >> >> Hello: >> >> Fairly new to Amibroker with a question regarding MA crossover. This is >> probably very simple to code, but I can't seem to wrap my head around it. >> I would like to have a filter that I include with buy logic as follows: >> Using S&P500 data, whenever price moves above 65 week moving average by >> 1%, filter = 1. Whenever price moves below MA by 1% filter = 0. >> >> The part I'm getting hung up on is what happens in between filter. Say >> price trends down from buy zone (1.01*65 week MA), but doesn't close >> below sell zone (.99*65 week MA). Then price comes back up above 1% buy >> filter. During this period, the filter should always = 1. But if it >> crosses 1% sell filter, it should become 0 until it crosses above 1% buy >> filter. >> >> I think I'm making this much more confusing than it needs to be. I'm >> sure there is a very simple way to program this - that's what I'm looking >> for. >> >> Thanks ahead of time, >> >> Levi >> > > > > > ------------------------------------ > > **** 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 > > > >