Yuki if for instance you have 1000 daily bars, but in a intraday database, depending on your setting, you could have 100000 bars or more even though you might have set periodicity to daily. the 1000 bars is being mapped to that 100000 bar database, and i think thats why its causing some weird looking values Though i haven't tried it myself. You could try this timeframeset(indaily); // your usual ATC code here timeframerestore(); In your data retrieving code do this instead Num = foreign(~10weekMA%", "V"); Den = foreign((~10weekMA%", "I"); PercentageRising = timeframeexpand(Num, indaily)/timeframeexpand(Den, indaily); //your plot statement. make sure the periodicity in your AA setting is the same as your database intraday setting. let me know if that works cheers
_____ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Yuki Taga Sent: Sunday, 18 March 2007 9:06 PM To: [email protected] Subject: [amibroker] ignorance personified (or) why don't I get this stuff? AB cognoscenti: (Franco, some Latin, maybe even Italian, for you.) For a long time, I have used a breadth indicator known to and used by many: (used intelligently, a darned-good breadth indicator) Above10Week = C >= MA(C,50); Buy = 0; // required -- does not generate signals AddToComposite(Above10Week, "~10WeekMA%", "V" ); /* add one to open interest field (we use this field as a counter) */ AddToComposite( 1, "~10WeekMA%", "I" ); PercentageRising = Foreign("~10WeekMA%", "V") / Foreign("~10WeekMA%", "I") * 100; Plot(PercentageRising,"Pct. of stocks above 10 Wk MA",colorBlack,styleLine,0,100,xshift=0); Plot(MA(PercentageRising,8),"",colorOrange,styleLine); PlotGrid(60, Color = colorDefault); PlotGrid(40, Color = colorDefault); Title = EncodeColor(colorBlack)+"Stocks above 10 week MA = " +WriteVal(PercentageRising,1.1,separator=True)+"%"; Little old me, a code-challenged idiot, did this all by herself; please try not to get a case of, as they said long ago in England, "the vapors". This works wonderfully, as far as producing a chart goes, in my EOD databases. But try as I might ... I cannot get it to produce anything other than "strange" in my eSignal database. Well, "weird" is other than "strange", but you get the idea. It's f*&[EMAIL PROTECTED], as they say in the vernacular. And I actually know what vernacular is, too. I have tried two things: 1) making sure settings periodicity is "daily" (DUH!) 2) adding code to set the time frame as daily for the first line, and then restoring it Neither works. The chart output is still "strange, weird, or even 'on drugs'". ("This is your chart on opiates! Your chart is ecstatic, but you are decidedly not.") I have come to the conclusion (a no-brainer) that I am simply incredibly stupid when it comes to this kind of thing, and therefore, that I must prostrate myself to those who know the secret handshake, or other Freemason-like rituals. I promise not to reveal your secrets, should you deign to share them with me, and that I will commit ritual suicide (oh, it's a nasty business that you don't want to know about) should you refuse. Please consider the unsightly mess that I am talking about, and kindly take mercy on my Japanese soul. Best, Yuki
