Hello!
Can we code an afl that will give us a signal alert on 30 minute breakout?
Any help appreciated
Pl. try following. I've coded and used it successfully many time.
//30 Minute Breakout AFL.
LastDayHigh=TimeFrameGetPrice( "H", inDaily, -1 );
LastDayLow =TimeFrameGetPrice( "L", inDaily, -1 );
Plot_Range1 = (TimeNum() >= 094900 AND TimeNum()<= 102000) AND (DateNum()==LastValue(DateNum()));
FirstBarHigh = ValueWhen(Plot_Range1, H) ;
FirstBarLow = ValueWhen(Plot_Range1, L) ;
Plot_Range2 = (TimeNum() >= 102600 AND TimeNum()<= 105600) AND (DateNum()==LastValue(DateNum()));
TestClose=ValueWhen(Plot_Range2,C);
//TestLow=ValueWhen(Plot_Range2,L);
Buy= TestClose> FirstBarHigh;
Sell= TestClose < FirstBarLow;
Filter=Buy OR Sell ;
SetOption("NoDefaultColumns", True );
AddTextColumn(Name(),"Security",1.2, colorDefault, colorDefault,90);
AddTextColumn(Now(0),"DateTime",1.2, colorDefault, colorDefault,90);
AddColumn(LastDayLow,"-Day Low",1.2, colorDefault, colorDefault,80);
AddColumn(LastDayHigh,"-Day High",1.2, colorDefault, colorDefault,80);
AddColumn(FirstBarHigh,"1stBarH",1.2, colorDefault, colorDefault,80);
AddColumn(FirstBarLow,"1stBarL",1.2, colorDefault, colorDefault,80);
AddColumn(TestClose,"TestClose",1.2, colorDefault, colorDefault,80);
//AddColumn(TestLow,"TestLow",1.2, colorDefault, colorDefault,80);
AddColumn(IIf(Buy,66,IIf(Sell,83,32)),"New Trade Bar", formatChar, colorWhite, bkcolor =IIf(Buy, colorGreen,IIf(Sell,colorRed,colorDefault)));
AddColumn(TimeFrameGetPrice( "C", inDaily),"Close",1.2,colorDefault,colorDefault,60);
AddColumn(TimeFrameGetPrice( "H", inDaily),"High",1.2,colorDefault,colorDefault,60);
AddColumn(TimeFrameGetPrice( "L", inDaily),"Low",1.2,colorDefault,colorDefault,60);
SetSortColumns(8);
AlertIf( Buy, "SOUND C:\\Windows\\Media\\chimes.wav", "Audio alert", 1, 1+8 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\ding.wav", "Audio alert", 2, 1+8 );