[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Is it possible to color only certain bars in a price chart based on criteria?


  • Date: Fri, 01 Jan 2010 03:28:24 -0600
  • From: Alan <alan@xxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Is it possible to color only certain bars in a price chart based on criteria?

PureBytes Links

Trading Reference Links



Create a new custom indicator naming it something like Price (color_range).
Then copy and paste the following code into it and save.

//start code
UL = Param("Upper price limit", 18, 10, 500, 1, 0);
LL = Param("Lower price limit", 10, 10, 500, 1, 0);
range = High -  Low;
Color = IIf( range < UL AND range >= LL , colorRed, colorBlue);
Plot( Close, "Close", Color, styleBar );
//end code

By default all bars between the range of 10 and 18 will be red all others will be blue.  You didn't specify the range so I just used these limits which can be changed in the code.  I used the S&P500 Index to test the code.

Hope this is what you were looking for.

Regards,
Alan


Potato Soup wrote:
 
Say if I want all bars that are between a certain range to be red and the rest blue, or something like that. Is that possible in AB?



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4733 (20091231) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___