The first plotshapes() is not constructed properly but your second one works OK. Using the code shown on the chart produces what you want.
Bill ----- Original Message ----- From: "Anthony C. Abry" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, December 02, 2007 9:30 PM 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 );
<<attachment: 2007-12-03_163734.gif>>
