Something along these lines should work:

x = v3 and (v3 > ref(v3, -1));
y = v4 and (v4 > ref(v4, -1));
color = iif(x, colorgreen, colorred);

Bill

----- Original Message ----- 
From: "dj9866" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, October 29, 2007 11:50 AM
Subject: [amibroker] Assistance request with modified ADX...please...


> With the attached coding, the colorbar1 switches with the crossover of
> PDI() and MDI().  Here is what I am trying to achieve...
> 
> When the PDI()>MDI() and the gap between the two is greater today than
> yesterday than use colorgreen in colorbar1...otherwise, use colorred
> in colorbar1 for that day.
> 
> When the MDI()>PDI()and the gap between the two is greater today than
> yesterday than use colorred in colorbar1...otherwise, use colorgreen
> in colorbar1 for that day. 
> 
> I have tried a number of different ways but have been unsuccessful. 
> Any help will be greatly appreciated!
> 
> range = Param("Periods", 14, 2, 200, 1 );
> Plot( ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue
> ), ParamStyle("ADX style", styleThick ) );
> Plot( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ),
> ParamStyle("+DI style") );
> Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ),
> ParamStyle("-DI style") );
> 
> V1=PDI();
> V2=MDI();
> V3=V1-V2; //diff when PDI>MDI...
> V4=V2-V1; //diff when MDI>PDI...
> ColorBar1 = IIf(V1 > V2,colorGreen,colorRed);
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.15.12/1098 - Release Date: 10/29/2007 
> 9:28 AM
> 
>

Reply via email to