- **Amibroker**
(*http://www.inditraders.com/amibroker/*)

- - **Dynamic ADR AFL-required code**
(*http://www.inditraders.com/amibroker/5395-dynamic-adr-afl-required-code.html*)

Dynamic ADR AFL-required codeHi experts
We use average daily range(daily high and daily low for tracking trading opportunities. Obviously you cant use a oneday average range. here is the concept. can somebody give it a afl form,please --------------- the concept is It computes yesterday's range (range= high - low),then the previous 5day, 10day and 20 days ranges. And it calculates the "Average Day Range" of these four ranges = (yesterday's+ Prev 5 Day Range + Prev 10 Day Range + Prev 20 Day Range)/4. So, if yesterday's Day Range was 80, the Previous 5 Day Range was 110, the Previous 10 Day Range was 90 and the Previous 20 Day Range was 120, then the Average Day Range would be 100. ADR is similar to weighted Day Range. the trading method is just wait for price to breakout above weadrhi or weadrlow on a price chart and go with tight stoploss. weadrhi=weighted adr hi some hints ------------------------------------------------------------ double AvgDayRange(int nth_day) { double R1,R5,R10,R20; int i; R1 = (iHigh(NULL,PERIOD_D1,nth_day)-iLow(NULL,PERIOD_D1,nth_day)); for(i=0;i<5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i)); for(i=0;i<10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i)); for(i=0;i<20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,nth_day+i)-iLow(NULL,PERIOD_D1,nth_day+i)); R5 = R5/5; R10 = R10/10; R20 = R20/20; return((R1+R5+R10+R20)/4); plot price plot weighted adr hi and lo lines on same chart ------------------------- one question if we take an average of past 36days hi and lo,range avrage,we must get adr as given above-i feel this way.is it correct? regards rvlv |

All times are GMT +5.5. The time now is 01:11 PM. |

iT

vB.Sponsors

vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2