Thanks Ed. Flip is exactly what i am looking for..
-gariki --- In [email protected], "Edward Pottasch" <empotta...@...> wrote: > > I have done work on combining multiple systems while leaving them intact > individually. It is posted in the amibroker-at group, Augustus, 10, 2010 > > your specific example can be simply solved as follows, rgds, Ed > > startime = 093459; > closetime = 160459; > > timeWindow = TimeNum() >= starttime AND TimeNum() <= closetime; > firstBarOfDay = TimeNum() >= starttime ;firstBarOfDay = firstBarOfDay - > Ref(firstBarOfDay,-1); > lastBarOfDay = TimeNum() >= closetime;lastBarOfDay = lastBarOfDay - > Ref(lastBarOfDay,-1); > > Buy = Cross(EMA(15), EMA(50)) AND timeWindow; > Sell = BarsSince(Buy) == 3000 OR lastBarOfDay == 1 > buy = ExRem(buy,sell); > sell = ExRem(sell,buy); > > > > > > From: gariki > Sent: Sunday, September 05, 2010 3:13 AM > To: [email protected] > Subject: [amibroker] System within system.. how to? > > > > Hello folks, > > So i have a system using arrays (not based on for loops). And i want to > introduce a bunch of filters into the system and i have coded the filters by > themselves. > > To now interject these filters into the original system, one way i can think > of is to convert the original system to use for loops so that i can write the > markers for the original system into static variables and use them along with > the filters to get the signals. > > But is there any way i can do that without converting the original system to > use for loops. > > i think i can make it work if i can somehow create an array that has say 1's > everywhere where the original system was in a long trade; and say use 2's to > mark for short trades. Then i can easily AND this part with the new filters > to get the final signals. > > Example: > > > > Original System: simple MA system > Buy = Cross(EMA(15), EMA(50)); > Sell = BarsSince(Buy) == 3000; // holding for a few days > > > New filter: dont hold overnight > Buy = TimeNum() == 093459; > Sell = TimeNum() == 160459; > > > > > > Thanks > -gariki >
