Camarilla AFL code for amibroker is posted here as per request from one of the regular member of marketcalls (Mr.Veer).
Camarilla AFL code in mainly used by intraday traders and it is used as an alternative to pivot points. And Iam not going much detail into the camarilla and how to trade using it. Just Explaining how the code is built.
Camarilla is basically made up of 8 pivot points. However L3,L4,H3,H4, Pivot Point are considered as the most important levels during intraday especially on 1min/5min charts.
The inputs are taken from the Yesterdays High, Yesterdays Low, Yesterdays Close and Todays Open. And the corresponding data is shown here. In case of Indian market opening time is considered as 9.15a.m(not using pre open levels). All these data are obtained from Daily timeframe though the trade levels are for intraday.
//—- pivot points
DayH = TimeFrameGetPrice(“H”, inDaily, -1); // yesterdays high
DayL = TimeFrameGetPrice(“L”, inDaily, -1); // low
DayC = TimeFrameGetPrice(“C”, inDaily, -1); // close
DayO = TimeFrameGetPrice(“O”, inDaily); // current day open
Camarilla levels are computed using the following formula. Here H3,H4,L3,L4 are used as R3,R4,S3,S4 respectively. Corresponding AFL code is shown below.
// camarilla pivots
if ( True )
R = DayH – DayL; // range
PP = (DayH + DayL + DayO + DayO) / 4 ;
R4 = (R * 1.1/2)+DayC;
R3 = (R * 1.1/4)+DayC;
S3 = DayC-(R * 1.1/4);
S4 = DayC- (R * 1.1/2);
The code also holds the exploration option to explore camarilla pivots for different stocks at single go.
Camarilla- Amibroker AFL Code