Thanks to both of you, but the problem remains. It seems as though the 15 minute variable resets at the very next 5 minute loop and doesn't hold its value. I do appreciate the help though and will keep working on it.
Thanks! Jim --- In [email protected], "Padhu" <[EMAIL PROTECTED]> wrote: > > Jim, > > Don't know if you searched the archives or not. > > Here is something I posted few days ago. You can use this as a base and build on it. > > > ================= > > TimeFrameSet( 1/4*inHourly ); // switch now to 1/4 hour (15mins) > > ADXIncreasingIn15Minute=ADX()>Ref(ADX(),-1); > > TimeFrameRestore(); > > > > ///Now in 5mins > > ADXIncreasingIn15Minute_expandedto5mins=TimeFrameExpand(ADXIncreasingIn15Minute,,1/4*inHourly,expandFirst); > > > > Now use ADXIncreasingIn15Minute_expandedto5mins to do the coloring logic etc. > > > > Cheers,Padhu > > ============================================================ > > ----- Original Message ----- > From: jrswindle2001 > To: [email protected] > Sent: Monday, October 15, 2007 8:42 PM > Subject: [amibroker] TimeFrameExpand ADX > > > Hope someone has had this problem before. I've never really used the > compression of timeframes. I can get compression to work fine for > SAR's but for the ADX (NDI/PDI) I can't seem to get it to work. > I am using a 5 minute timeframe (with a 1 minute data feed), and the > 15 minute only shows the correct signal every 3 bars (and it should > show on every bar I would think). For example, it should show the red > color for, say 15 bars. Instead it shows red, yellow, yellow, red, > yellow, yellow, red... > > Any help would be greatly appreciated! > > Thanks, > Jim > > // 15 minute > TimeFrameSet( in15Minute ); > > nADX2 = ADX(range) ; > nPDI2 = PDI(range); > nMDI2 = MDI(range) ; > > TimeFrameRestore(); // restore time frame to original > > nADX2 = TimeFrameExpand(nADX2, in15Minute) ; > nPDI2 = TimeFrameExpand(nPDI2, in15Minute) ; > nMDI2 = TimeFrameExpand(nMDI2, in15Minute) ; > > // if the ADX is going up and the PDI is over NDI, then make it green, > // If NDI over PDI then make it red, else make it yellow. > ColorADX2 = IIf(nADX2 > Ref(nADX2,-1), IIf(nPDI2 > > nMDI2,colorGreen,colorRed), colorYellow) ; > > Plot(nADX2, "ADX2", ColorADX2, styleDots+styleNoLine ); >
