DEAR BROTHERS,
TRIED TO MAKE AN AFL FOR POINT AND FIGURE CHART IN NORMAL FORMAT AND REACHED HERE. IF ANYBODY CANMAKE MONEY OUT OF THIS I WILL BE HAPPY. IFANYBODY CAN SUGGEST IMPROVEMNT ON THIS AFL THEY R WELCOME
VYASA
//SetBarsRequired(100000,100000);
//Size for P&F boxes
boxsize=IIf(C>=0.01 AND C<10, 0.05,
IIf(C>=10 AND C<20, 0.10,
IIf(C>=20 AND C<30, 0.15,
IIf(C>=30 AND C<40, 0.20,
IIf(C>=40 AND C<50, 0.25,
IIf(C>=50 AND C<60, 0.30,
IIf(C>=60 AND C<70, 0.35,
IIf(C>=70 AND C<80, 0.40,
IIf(C>=80 AND C<90, 0.45,
IIf(C>=90 AND C<100, 0.50,
IIf(C>=100 AND C<150, 0.75,
IIf(C>=150 AND C<200, 1.00,
IIf(C>=200 AND C<250, 1.25,
IIf(C>=250 AND C<300, 1.50,
IIf(C>=300 AND C<350, 1.75,
IIf(C>=350 AND C<400, 2.00,
IIf(C>=400 AND C<450, 2.25,
IIf(C>=450 AND C<500, 2.50,
IIf(C>=500 AND C<550, 2.75,
IIf(C>=550 AND C<600, 3.00,
IIf(C>=600 AND C<650, 3.25,
IIf(C>=650 AND C<700, 3.50,
IIf(C>=700 AND C<750, 3.75,
IIf(C>=750 AND C<800, 4.00,
IIf(C>=800 AND C<850, 4.25,
IIf(C>=850 AND C<900, 4.50,
IIf(C>=900 AND C<950, 4.75,
IIf(C>=950 AND C<1000, 5.00,
IIf(C>=1000 AND C<1100, 5.50,
IIf(C>=1100 AND C<1200, 6.00,
IIf(C>=1200 AND C<1300, 6.50,
IIf(C>=1300 AND C<1400, 7.00,
IIf(C>=1400 AND C<1500, 7.50,
IIf(C>=1500 AND C<1600, 8.00,
IIf(C>=1600 AND C<1700, 8.50,
IIf(C>=1700 AND C<1800, 9.00,
IIf(C>=1800 AND C<1900, 9.50,
IIf(C>=1900 AND C<2000, 10.00,
IIf(C>=2000 AND C<2100, 10.50,
IIf(C>=2100 AND C<2200, 11.00,
IIf(C>=2200 AND C<2300, 11.50,
IIf(C>=2300 AND C<2400, 12.00,
IIf(C>=2400 AND C<2500, 12.50,
IIf(C>=2500 AND C<2600, 13.00,
IIf(C>=2600 AND C<2700, 13.50,
IIf(C>=2700 AND C<2800, 14.00,
IIf(C>=2800 AND C<2900, 14.50,
IIf(C>=2900 AND C<3000, 15.00,
IIf(C>=3000 AND C<3100, 15.50,
IIf(C>=3100 AND C<3200, 16.00,
IIf(C>=3200 AND C<3300, 16.50,
IIf(C>=3300 AND C<3400, 17.00,
IIf(C>=3400 AND C<3500, 17.50,
IIf(C>=3500 AND C<3600, 18.00,
IIf(C>=3600 AND C<3700, 18.50,
IIf(C>=3700 AND C<3800, 19.00,
IIf(C>=3800 AND C<3900, 19.50,
IIf(C>=3900 AND C<4000, 20.00,
IIf(C>=4000 AND C<4100, 20.50,
IIf(C>=4100 AND C<4200, 21.00,
IIf(C>=4200 AND C<4300, 21.50,
IIf(C>=4300 AND C<4400, 22.00,
IIf(C>=4400 AND C<4500, 22.50,
IIf(C>=4500 AND C<4600, 23.00,
IIf(C>=4600 AND C<4700, 23.50,
IIf(C>=4700 AND C<4800, 24.00,
IIf(C>=4800 AND C<4900, 24.50,
IIf(C>=4900 AND C<5000, 25.00,
IIf(C>=5000 AND C<6000, 30,
IIf(C>=6000 AND C<7000, 35,
IIf(C>=7000 AND C<8000, 40,
IIf(C>=8000 AND C<9000, 45,
IIf(C>=9000 AND C<10000, 50,
IIf(C>=10000 AND C<11000, 55,
IIf(C>=11000 AND C<12000, 60,
IIf(C>=12000 AND C<13000, 65,
IIf(C>=13000 AND C<14000, 70,
IIf(C>=14000 AND C<15000, 75,
IIf(C>=15000 AND C<16000, 80,
IIf(C>=16000 AND C<17000, 85,
IIf(C>=17000 AND C<18000, 90,
IIf(C>=18000 AND C<19000, 95,
IIf(C>=19000 AND C<20000, 100,
IIf(C>=20000 AND C<21000, 105,
IIf(C>=21000 AND C<22000, 110,
IIf(C>=22000 AND C<23000, 115,
IIf(C>=23000 AND C<24000, 120,
IIf(C>=24000 AND C<25000, 125,
IIf(C>=25000 AND C<26000, 130,
IIf(C>=26000 AND C<27000, 135,
IIf(C>=27000 AND C<28000, 140,
IIf(C>=28000 AND C<29000, 145,
IIf(C>=29000 AND C<30000, 150,
IIf(C>=30000 AND C<31000, 155,
IIf(C>=31000 AND C<32000, 160,
IIf(C>=32000 AND C<33000, 165,
IIf(C>=33000 AND C<34000, 170,
IIf(C>=34000 AND C<35000, 175,
200 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
Box = (BOXSIZE);
HX = round((H/box)*10)/10;
LX = round((L/box)*10)/10;
RH = floor(HX);
FL = ceil(LX);
ut=H>Ref(H,-1);
dt=L<Ref(L,-1);
But=BarsSince(ut ) ;
bdt=BarsSince(dt );
Hut=HHV(H,bdt>=3 AND abs(ROC(H,3))>=3*box/100);
Ldt=LLV(L,but>=3 AND abs(ROC(L,3))>=3*box/100);
//Plot(3*BOX,"3*BOX",colorBrown,styleLine);
//Plot(Hut,"hut",colorRed,styleLine);
//Plot(Ldt,"ldt",colorGreen,styleLine);
res=ValueWhen(Hut==Ref(Hut,-1) AND Ref(Hut,-1)==Ref(Hut,-2) AND Ref(Hut,-2)==Ref(Hut,-3),int(Hut+.5),1);
Plot(res,"res",colorBlue,styleLine);
sup=ValueWhen(ldt==Ref(ldt,-1) AND Ref(ldt,-1)==Ref(ldt,-2) AND Ref(ldt,-2)==Ref(ldt,-3),int(ldt+.5));
Plot(sup,"sup",colorBrown,styleLine);
BSUP=BarsSince(SUP!=Ref(SUP,-1));
//Plot(BSUP,"BSUP",colorRed,styleLine);
BRES=BarsSince(RES!=Ref(RES,-1));
//Plot(BRES,"BRES",colorRed,styleLine);
boxcolor=IIf(ROC(C,1)>=box AND C>res,colorGreen,IIf(ROC(C,1)<box AND C>res,colorRed,IIf(ROC(C,1)>=box AND C<sup,colorGreen,IIf(ROC(C,1)<box AND C<sup,colorRed,colorBlack))));
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", boxcolor , styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
Buy=Cross(C,RES) AND MACD()>Signal() AND Signal()>0;
PlotShapes(Buy*shapeUpArrow,colorGreen);
Short=Cross(SUP,C) AND MACD()<Signal() AND Signal()<0;
PlotShapes(Short*shapeDownArrow,colorRed);
_SECTION_END();
TRIED TO MAKE AN AFL FOR POINT AND FIGURE CHART IN NORMAL FORMAT AND REACHED HERE. IF ANYBODY CANMAKE MONEY OUT OF THIS I WILL BE HAPPY. IFANYBODY CAN SUGGEST IMPROVEMNT ON THIS AFL THEY R WELCOME
VYASA
//SetBarsRequired(100000,100000);
//Size for P&F boxes
boxsize=IIf(C>=0.01 AND C<10, 0.05,
IIf(C>=10 AND C<20, 0.10,
IIf(C>=20 AND C<30, 0.15,
IIf(C>=30 AND C<40, 0.20,
IIf(C>=40 AND C<50, 0.25,
IIf(C>=50 AND C<60, 0.30,
IIf(C>=60 AND C<70, 0.35,
IIf(C>=70 AND C<80, 0.40,
IIf(C>=80 AND C<90, 0.45,
IIf(C>=90 AND C<100, 0.50,
IIf(C>=100 AND C<150, 0.75,
IIf(C>=150 AND C<200, 1.00,
IIf(C>=200 AND C<250, 1.25,
IIf(C>=250 AND C<300, 1.50,
IIf(C>=300 AND C<350, 1.75,
IIf(C>=350 AND C<400, 2.00,
IIf(C>=400 AND C<450, 2.25,
IIf(C>=450 AND C<500, 2.50,
IIf(C>=500 AND C<550, 2.75,
IIf(C>=550 AND C<600, 3.00,
IIf(C>=600 AND C<650, 3.25,
IIf(C>=650 AND C<700, 3.50,
IIf(C>=700 AND C<750, 3.75,
IIf(C>=750 AND C<800, 4.00,
IIf(C>=800 AND C<850, 4.25,
IIf(C>=850 AND C<900, 4.50,
IIf(C>=900 AND C<950, 4.75,
IIf(C>=950 AND C<1000, 5.00,
IIf(C>=1000 AND C<1100, 5.50,
IIf(C>=1100 AND C<1200, 6.00,
IIf(C>=1200 AND C<1300, 6.50,
IIf(C>=1300 AND C<1400, 7.00,
IIf(C>=1400 AND C<1500, 7.50,
IIf(C>=1500 AND C<1600, 8.00,
IIf(C>=1600 AND C<1700, 8.50,
IIf(C>=1700 AND C<1800, 9.00,
IIf(C>=1800 AND C<1900, 9.50,
IIf(C>=1900 AND C<2000, 10.00,
IIf(C>=2000 AND C<2100, 10.50,
IIf(C>=2100 AND C<2200, 11.00,
IIf(C>=2200 AND C<2300, 11.50,
IIf(C>=2300 AND C<2400, 12.00,
IIf(C>=2400 AND C<2500, 12.50,
IIf(C>=2500 AND C<2600, 13.00,
IIf(C>=2600 AND C<2700, 13.50,
IIf(C>=2700 AND C<2800, 14.00,
IIf(C>=2800 AND C<2900, 14.50,
IIf(C>=2900 AND C<3000, 15.00,
IIf(C>=3000 AND C<3100, 15.50,
IIf(C>=3100 AND C<3200, 16.00,
IIf(C>=3200 AND C<3300, 16.50,
IIf(C>=3300 AND C<3400, 17.00,
IIf(C>=3400 AND C<3500, 17.50,
IIf(C>=3500 AND C<3600, 18.00,
IIf(C>=3600 AND C<3700, 18.50,
IIf(C>=3700 AND C<3800, 19.00,
IIf(C>=3800 AND C<3900, 19.50,
IIf(C>=3900 AND C<4000, 20.00,
IIf(C>=4000 AND C<4100, 20.50,
IIf(C>=4100 AND C<4200, 21.00,
IIf(C>=4200 AND C<4300, 21.50,
IIf(C>=4300 AND C<4400, 22.00,
IIf(C>=4400 AND C<4500, 22.50,
IIf(C>=4500 AND C<4600, 23.00,
IIf(C>=4600 AND C<4700, 23.50,
IIf(C>=4700 AND C<4800, 24.00,
IIf(C>=4800 AND C<4900, 24.50,
IIf(C>=4900 AND C<5000, 25.00,
IIf(C>=5000 AND C<6000, 30,
IIf(C>=6000 AND C<7000, 35,
IIf(C>=7000 AND C<8000, 40,
IIf(C>=8000 AND C<9000, 45,
IIf(C>=9000 AND C<10000, 50,
IIf(C>=10000 AND C<11000, 55,
IIf(C>=11000 AND C<12000, 60,
IIf(C>=12000 AND C<13000, 65,
IIf(C>=13000 AND C<14000, 70,
IIf(C>=14000 AND C<15000, 75,
IIf(C>=15000 AND C<16000, 80,
IIf(C>=16000 AND C<17000, 85,
IIf(C>=17000 AND C<18000, 90,
IIf(C>=18000 AND C<19000, 95,
IIf(C>=19000 AND C<20000, 100,
IIf(C>=20000 AND C<21000, 105,
IIf(C>=21000 AND C<22000, 110,
IIf(C>=22000 AND C<23000, 115,
IIf(C>=23000 AND C<24000, 120,
IIf(C>=24000 AND C<25000, 125,
IIf(C>=25000 AND C<26000, 130,
IIf(C>=26000 AND C<27000, 135,
IIf(C>=27000 AND C<28000, 140,
IIf(C>=28000 AND C<29000, 145,
IIf(C>=29000 AND C<30000, 150,
IIf(C>=30000 AND C<31000, 155,
IIf(C>=31000 AND C<32000, 160,
IIf(C>=32000 AND C<33000, 165,
IIf(C>=33000 AND C<34000, 170,
IIf(C>=34000 AND C<35000, 175,
200 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));
Box = (BOXSIZE);
HX = round((H/box)*10)/10;
LX = round((L/box)*10)/10;
RH = floor(HX);
FL = ceil(LX);
ut=H>Ref(H,-1);
dt=L<Ref(L,-1);
But=BarsSince(ut ) ;
bdt=BarsSince(dt );
Hut=HHV(H,bdt>=3 AND abs(ROC(H,3))>=3*box/100);
Ldt=LLV(L,but>=3 AND abs(ROC(L,3))>=3*box/100);
//Plot(3*BOX,"3*BOX",colorBrown,styleLine);
//Plot(Hut,"hut",colorRed,styleLine);
//Plot(Ldt,"ldt",colorGreen,styleLine);
res=ValueWhen(Hut==Ref(Hut,-1) AND Ref(Hut,-1)==Ref(Hut,-2) AND Ref(Hut,-2)==Ref(Hut,-3),int(Hut+.5),1);
Plot(res,"res",colorBlue,styleLine);
sup=ValueWhen(ldt==Ref(ldt,-1) AND Ref(ldt,-1)==Ref(ldt,-2) AND Ref(ldt,-2)==Ref(ldt,-3),int(ldt+.5));
Plot(sup,"sup",colorBrown,styleLine);
BSUP=BarsSince(SUP!=Ref(SUP,-1));
//Plot(BSUP,"BSUP",colorRed,styleLine);
BRES=BarsSince(RES!=Ref(RES,-1));
//Plot(BRES,"BRES",colorRed,styleLine);
boxcolor=IIf(ROC(C,1)>=box AND C>res,colorGreen,IIf(ROC(C,1)<box AND C>res,colorRed,IIf(ROC(C,1)>=box AND C<sup,colorGreen,IIf(ROC(C,1)<box AND C<sup,colorRed,colorBlack))));
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", boxcolor , styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
Buy=Cross(C,RES) AND MACD()>Signal() AND Signal()>0;
PlotShapes(Buy*shapeUpArrow,colorGreen);
Short=Cross(SUP,C) AND MACD()<Signal() AND Signal()<0;
PlotShapes(Short*shapeDownArrow,colorRed);
_SECTION_END();