Don't you want the current bar to be the longest of the 4 bars? If so, use WR4 = (H - L) > Ref(HHV(H-L,3),-1);
Also, replace IIf (WR4 = 1.... by IIf (WR4 == 1.... Bob -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony C. Abry Sent: Sunday, December 02, 2007 6:30 PM To: [email protected] Subject: [amibroker] plotshapes changes array? Hi, I am fighting with the usage of plotshapes. My goal is to highlight widerange bars (WR4) on a chart. WR4 is true if 1 and not true if -1. The formula seems to calculate everything correctly as cross checked within exploration and addcolumns. However, when trying to plot this with the plotshapes command on top of the bar, it will change the WR4 value to 1 and plot it on every single bar. I got 2 version of the plotshape command in there for you to look at. Any help would be greatly appreciated. Anthony --------------------------------------------------------------- // WR4 show me // D1 = H-L; D2 = Ref(H,-1)-Ref(L,-1); D3 = Ref(H,-2)-Ref(L,-2); D4 = Ref(H,-3)-Ref(L,-3); WR4 = 0; WR4 = IIf(D1 > (D2 OR D3 OR D4),1,-1); //IIf (WR4 = 1,(PlotShapes( shapeSmallSquare, colorYellow, 0, H * 1.03 )),PlotShapes(shapeNone,colorGreen)); //PlotShapes( IIf( WR4 > 0, shapeSmallSquare, shapeNone ), colorYellow, 0, H * 1.03); Filter = WR4; AddColumn( D1, "D1", 1.4 ); AddColumn( D2, "D2", 1.4 ); AddColumn( D3, "D3", 1.4 ); AddColumn( D4, "D4", 1.4 ); AddColumn( WR4, "WR4", 1.4 ); 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
