Uhhh ... I wouldn't call that plain ... But in any case ... To picture what happens below in the arrays let's assume C goes above MA(C, 30) on bar 1 and under on bar 7 ...
If your Trend condition was for some reason SIGNAL oriented and you wanted to know what state it was in then yes you could use Flip to populate the rest of the two arrays i.e. UpTrend = Cross(C, MA(C, 30)); // Or whatever DnTrend = Cross(MA(C, 30), C); // Or whatever The arrays for bars 1 through 9 would now look like: UpTrend 100000000 DnTrend 000000100 UpTrend = Flip(UpTrend, DnTrend); DnTrend = Flip(DnTrend, UpTrend); The arrays for bars 1 through 9 would now look like: UpTrend 111111000 DnTrend 000000111 You'd get the same as the above by writing the STATE oriented statements ... UpTrend = C > MA(C, 30); DnTrend = C < MA(C, 30); // Or if you prefer DnTrend = Not UpTrend With the above arrays in STATE orientation if you then for some reason write: UpTrend = ExRem(UpTrend, DnTrend); DnTrend = ExRem(DnTrend, UpTrend); Then the arrays are changed to signal orientation again i.e. ... UpTrend 100000000 DnTrend 000000100 --- In [email protected], "Rakesh Sahgal" <[EMAIL PROTECTED]> wrote: > > So in plain English if I were to look for a correction in an upswing [a] I > would define the trend conditions , [b] use flip as you detailed above to > test for the trend condition i.e. uptrend or downtrend and [c] finally look > for a correction when buy=1 or sell=1? The idea is to go for the first > correction in the trend i.e. something like the wave 2 per Elliot Wave > parlance. > > R > > On 6/6/07, Fred <[EMAIL PROTECTED]> wrote: > > > > You understand loops, but not ExRem (Signal) & Flip (State) ? > > > > It would have been easy enough for you to come to your own > > realization simply by looking at an exploration after using Flip and > > then again after using Flip ... > > > > In case you still don't understand, > > > > Buy = Flip(Buy, Sell); > > Sell = Flip(Sell, Buy); > > > > ... would set all values in the buy array to 1 from each buy until > > the next sell and all values in the sell array to 1 until the next > > buy ... > > > > Buy = ExRem(Buy, Sell); > > Sell = ExRem(Sell, Buy); > > > > ... would remove all but the original buy and sell in the respective > > arrays ... > > > > Now you can toss the loops and have your code run faster ... > > > > --- In [email protected], Grant Noble <gruntus@> wrote: > > > > > > As someone who struggled with ExRem I can understand the confusion. > > > I eventually abandoned it and defined all my signals via loop code. > > > The whole notion of state v. signal form is something that could do > > with a little more explanation > > > in the user guide - not all of us have engineering backgrounds.. G > > > > > > Tomasz Janeczko wrote: > > > > Angelo, > > > > > > > > The purpose of ExRem is to convert from STATE form to SIGNAL form. > > > > The difference is as between > > > > > > > > Buy = Close > MA( Close, 24 ); > > > > > > > > and > > > > > > > > Buy = Cross( Close, MA( Close, 24 ) ); > > > > > > > > First is state form, second is signal form. As far as default > > mode of backtesting is considered > > > > there is no much difference AS LONG as you don't combine multiple > > conditions. > > > > > > > > But once you start using AND/OR it makes the difference. > > > > > > > > The other difference is when you are going to PLOT the chart (or > > arrows using PlotShapes). > > > > First form will give you "level" while second form will give > > you "pulse". > > > > > > > > Use Exploration and charts to see what I am talking about. > > > > > > > > Best regards, > > > > Tomasz Janeczko > > > > amibroker.com > > > > ----- Original Message ----- > > > > From: "Angelo" <ima_cons@> > > > > To: <[email protected]> > > > > Sent: Tuesday, June 05, 2007 10:46 AM > > > > Subject: [amibroker] Re: once again, this AFL fights you every > > step of the way. Sorry, this is a badl > > > > > > > > > > > >> --- In [email protected], "Bob Jagow" <bjagow@> wrote: > > > >>> You confuse signal with Buy/Sell. > > > >>> > > > >> > > > >> I surely do. > > > >> > > > >> That's why I came here asking if someone has the courtesy of > > explaining > > > >> when/why there's the need to remove a signal that won't create > > an > > > >> actual Buy/Sell. > > > >> > > > >> If it is possble, otherwise life will be good all the same. > > > >> > > > >> Regards, > > > >> > > > >> Angelo. > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> Please note that this group is for discussion between users only. > > > >> > > > >> To get support from AmiBroker please send an e-mail directly to > > > >> SUPPORT {at} amibroker.com > > > >> > > > >> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > > >> http://www.amibroker.com/devlog/ > > > >> > > > >> For other support material please check also: > > > >> http://www.amibroker.com/support.html > > > >> > > > >> Yahoo! Groups Links > > > >> > > > >> > > > >> > > > >> > > > >> > > > > > > > > > > > > Please note that this group is for discussion between users only. > > > > > > > > To get support from AmiBroker please send an e-mail directly to > > > > SUPPORT {at} amibroker.com > > > > > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > > > http://www.amibroker.com/devlog/ > > > > > > > > For other support material please check also: > > > > http://www.amibroker.com/support.html > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Please note that this group is for discussion between users only. > > > > To get support from AmiBroker please send an e-mail directly to > > SUPPORT {at} amibroker.com > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > http://www.amibroker.com/devlog/ > > > > For other support material please check also: > > http://www.amibroker.com/support.html > > > > Yahoo! Groups Links > > > > > > > > >
