Hello,

Based on my very limited programming abilities try "Ref" like:

http://www.amibroker.com/f?ref


Color = IIf( V3 > Ref(V3,-1), colorGreen,colorRed); 


Plot( 4, "ColorBar", Color, styleArea | styleOwnScale,-0.1,100);

Jerry Gress
Stockton, Ca.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of dj9866
Sent: Wednesday, October 31, 2007 3:04 PM
To: [email protected]
Subject: [amibroker] What am I overlooking in generating color bar???

I am trying to generated a green/red colorbar across the bottom of the
indicator plot.  I have it working properly in a number of other
indicator plots, but not this one.  The value of the color array is
displayed in the interpertation window and changes between green and
red as the vertical cursor is moved across the screen.  However, the
colorbar is a solid color all the way across the screen. As the screen
is shifted left or right the colorbar will change to all green or all red.

Any assistance is appreciated.

_SECTION_BEGIN("ModADX");
range = Param("Periods", 14, 2, 200, 1 );
Plot( ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue
), ParamStyle("ADX style", styleThick ) );
Plot( MA(PDI(range),5), "+DI", ParamColor( "+DI color", colorGreen ),
ParamStyle("+DI style") );
Plot( MA(MDI(range),5), "-DI", ParamColor( "-DI color", colorRed ),
ParamStyle("-DI style") );

V1=MA(PDI(),5);
V2=MA(MDI(),5);
V3=V1-V2;       //Value>0=PDI>MDI...value<0 then MDI>PDI...
if (V3[BarCount-1]>0)
        Color = IIf( V3[BarCount-1]>V3[BarCount-2], colorGreen,colorRed); 
else
        Color = IIf( V3[BarCount-1]<V3[BarCount-2], colorRed,colorGreen); 

Plot( 4, "ColorBar", Color, styleArea | styleOwnScale,-0.1,100);
printf("V3*********\n");
WriteVal(V3);
printf("Color**********\n");
WriteVal(Color);
_SECTION_END();



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




Reply via email to