Amibroker assistance - coding Bill William's price bars ohlc

#11
Hi,
Sorry for the delay...
Here's the rectified Color Coding of Price Bars( Bill Williams ) by Mr.Joris M.schuller

Formula:


_SECTION_BEGIN("Bill william's Price Bars BARS");
R=(H-L);//RANGE;

FR=(H-L)/3;//THIRD OF RANGE;

S1=H-FR;//SEGMENT ONE;

S2=H-2*FR;//SEGMENT TWO;

S3=L;//SEGMENT THREE;

/*POSITION OF OPEN AND CLOSE RELATIVE TO BAR*/

P=IIf(O>S1,1,IIf(S1>O<S2,2,IIf(S2>O<L,3,0)));// POSITION OF OPENING PRICE ;

CL=IIf(C>S1,1,IIf(S1>C<S2,2,IIf(S2>C<L,3,0)));// POSITION OF CLOSING PRICE;

/*CONDITIONAL STATEMENTS */


COND_C=((P==2 OR P==3) AND CL==1) OR (P==3 AND (CL==1 OR CL==2)); //CLIMBERS(eq. 1)

COND_C=(P==2 /*OR P==3)*/ AND CL==1) OR (P==3 AND (CL==1 OR CL==2));//CLIMBERS (eq. 1a)


COND_D=(P==1 AND (CL==2 OR CL==3)) OR (P==2 AND (CL==2 OR CL==3));//DRIFTERS

COND_N=((P==CL) AND ( P==1 OR P==2 OR P==3)); //NEUTRAL BARS

DYNAMIC_COLOR=IIf(COND_C,colorGreen,IIf(COND_D,colorRed,IIf(COND_N,colorBlue,colorGold)));

PlotOHLC( Open, High, Low, Close, "Price chart ",DYNAMIC_COLOR,styleBar);

_SECTION_END();
 
#12
Dear Mr 12323,

After seeing the post I thought even I will ask my query, it might get solved. I want to have a Buy and Sell arrows on a formula which states that

Buy when current Bar's close is greater than Previous 20th Bar's close ( Not all the previous 20 bars, only 20th Bar ) Difference Must be => 0.5 %

AND

Sell when current Bar's close is Less than Previous 20th Bar's close ( Not all the prevois 20 bars, only 20th Bar ) Difference must be => 0.5 %

I use 5 mins charts intraday realtime feed..

is this possible ? If yes then please help & guide..

Thanks & Regards

Avinash Raste
 
Last edited:

Similar threads