MACD BB Indicator development for Amibroker

Joined
Mar 25, 2009
Messages
20
Likes
8
#41
Thanks Casoni for the support... But actually I am looking more into Alert output or exploration rather than the charts coz you cant check all charts every minute since this works only for day trading. If the Alert can mention the name of the stocks near to its 2days breakout or breakdown levels, it would be easy to go and check those charts and take a decision.But my AFL gives same results again and again. The same results should not be repeated. As far as your chart is concerned, thats what I am looking for. So ultimately what I am looking for is an output which will have "Buy above (previous days high), Stop Loss (most recent low of this upmove or most recent high for the down move), targets 1,2,3 (these are the resistance levels). Thanks a million Casoni for the response (By the way I am becoming a better AFL coder these days !!!!)
 

casoni

Well-Known Member
Joined
Feb 19, 2006
Messages
395
Likes
487
#42
Hello,
instead of using ALERT ..Ill prefer to use exploration [ explore at every 5 min ]:)
i hope this will be useful,
Thank you
 
Last edited:
Joined
May 27, 2009
Messages
35
Likes
6
#43
Hello,
instead of using ALERT ..Ill prefer to use exploration [ explore at every 5 min ]:)
i hope this will be useful,
Thank you
casoni, the afl you updated is missing the resistance levels
any idea?

everything else is working perfectly though
thanks for the code
 

santhosh44

Active Member
Joined
Feb 7, 2008
Messages
222
Likes
102
#44
A bit late to this thread.. casoni, found that you've deleted all attachments (afls ) .. any reason for deletion?

if u have no issues, can you please attach the latest version again?
 

casoni

Well-Known Member
Joined
Feb 19, 2006
Messages
395
Likes
487
#45
A bit late to this thread.. casoni, found that you've deleted all attachments (afls ) .. any reason for deletion?

if u have no issues, can you please attach the latest version again?[/QUOTEyes

Hello santhosh,
i had deleted all attachments, because i was unable to upload new files,:confused: [ i was getting message that i have reached my limits ] even today i cant upload :mad:
** i ll upload all formulas [ which i had posted on 4shared and put that link here]
Thank you
 

mfire

Active Member
Joined
Feb 4, 2006
Messages
100
Likes
68
#46
A bit late to this thread.. casoni, found that you've deleted all attachments (afls ) .. any reason for deletion?

if u have no issues, can you please attach the latest version again?[/QUOTEyes

Hello santhosh,
i had deleted all attachments, because i was unable to upload new files,:confused: [ i was getting message that i have reached my limits ] even today i cant upload :mad:
** i ll upload all formulas [ which i had posted on 4shared and put that link here]
Thank you
Casoni,
I am also waiting for your next post for the link of your afl file for MACD BB INDICATOR latest version. I was impressed by the results and the chart you have posted. Till now I was working with those indicators indivisually but the combination does more fine tunining I think.
Thanks for the same in advance.
Mfire.
 

casoni

Well-Known Member
Joined
Feb 19, 2006
Messages
395
Likes
487
#50
Hi,

Please provide the AFL

GG
Hello everyone.

//formula. for breakout

// Calculations for Buy and Sell Signals-------------------------------
LastDayHigh=TimeFrameGetPrice( "H", inDaily, -1 );
LastDayLow =TimeFrameGetPrice( "L", inDaily, -1 );
LastDayclose=TimeFrameGetPrice( "c", inDaily, -1 );
TodayHigh = SelectedValue(TimeFrameGetPrice( "H", inDaily, 0 ));
TodayLow = SelectedValue(TimeFrameGetPrice( "L", inDaily, 0 ));
TwoDayHigh = IIf(LastDayHigh > TodayHigh, LastDayHigh, TodayHigh);
TwoDayLow = IIf(LastDayLow < TodayLow, LastDayLow, ToDayLow);

//Plot_Range1 = (TimeNum() >= 095500 AND TimeNum()<= 160000) AND (DateNum()==LastValue(DateNum()));

mf = Param("Percentage",0.5,0.1,5,0.1);

ORhigh = LastDayHigh*(1+mf/100);
ORlow = LastDayLow*(1-mf/100);

BreakOut = IIf(Close>=ORhigh, Close, 0);
breakDown = IIf(Close<=ORlow, Close, 0);

p = ( LastDayHigh+ LastDayLow + LastDayclose )/3;
s1 = (2*p)-LastDayHigh;
r1 = (2*p)-LastDayLow;
s2 = p -(LastDayHigh - LastDayLow);
s3 = S1-(LastDayHigh-LastDayLow);
r2 = p +(LastDayHigh - LastDayLow);
r3 = R1+(LastDayHigh-LastDayLow);


Buy = (Close >= ORHigh) OR (Close<=LastDayHigh) AND (Close>=p) AND (Now(format=4)-TimeNum()<500) ;
Sell =(Close <= ORLow) OR (Close>=LastDayLow) AND (Close<=p) AND (Now(format=4)-TimeNum()<500) ;

Buy=ExRem (Buy, Sell);
Sell=ExRem (Sell, Buy);

BTarget1 = IIf(Buy,IIf(r1 >= LastDayHigh, r1, IIf(r2 >= LastDayHigh, r2, IIf(r3 >= LastDayHigh, r3, 0))),0);
BTarget2 = IIf(Buy,IIf(r1 == BTarget1, r2, IIf(r2 == BTarget1, r3, 0)),0);
BTarget3 = IIf(Buy,IIf(r2 == BTarget2, r3, 0),0);

STarget1 = IIf(Sell,IIf(s1 <= LastDayLow, s1, IIf(s2 <= LastDayLow, s2, IIf(s3 <= LastDayLow, s3, 0))),0);
STarget2 = IIf(Sell,IIf(s1 == STarget1, s2, IIf(s2 == STarget1, s3, 0)),0);
STarget3 = IIf(Sell,IIf(s2 == STarget2, s3, 0),0);

COL=IIf(BreakOut,colorGreen,IIf(breakDOWN,colorYellow,Null));
Plot(C,"",COL,128);
vr=ParamToggle("Plotlines","Yes|No" ,0);
if(VR == 0)
{
Plot(LastDayHigh,"High Breakout", ParamColor("Hi Color",colorBlue));
Plot(LastDayLow,"Low Breakout", ParamColor("Low Color",colorRed));
Plot(ORHigh,"ORH", ParamColor("ORHi Color",colorBlue),32);
Plot(ORLow,"ORL", ParamColor("ORLow Color",colorRed),32);
Plot(P,"PIVOT", ParamColor("P Color",colorTan),8);
Plot(R1,"", ParamColor("R1 Color",colorGreen),1);
Plot(R2,"", ParamColor("R2 Color",colorGreen),1);
Plot(S1,"", ParamColor("S1 Color",colorLightOrange),1);
Plot(S2,"", ParamColor("S2 Color",colorLightOrange),1);
}
PlotShapes(Buy*shapeUpArrow,5,0,L,-15);
PlotShapes(Sell*shapeDownArrow,4,0,H,-15);
Bprice=IIf(Buy,Close,0);
Sprice=IIf(Sell,Close,0);
Title = EncodeColor(colorWhite)+ "2daybrek( "+mf+")%" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+EncodeColor(colorPink) +"-----------------------------system says----------------------------------------"+"\n"+
EncodeColor(colorLime)+
WriteIf (Buy , "GO LONG / cover at ="+C+"\n"+EncodeColor(colorRed)
+"Stop- toadys low ="+TodayLow+"\n"+EncodeColor(colorGreen)
+"T1 ="+BTarget1+"\n"+EncodeColor(colorPaleGreen) +"T2 ="+BTarget2+"","")+
EncodeColor(colorYellow)+
WriteIf (Sell ,"EXIT LONG / short at "+C+"\n"+EncodeColor(colorRed)
+"Stop-todays high "+Todayhigh+"\n"+EncodeColor(colorOrange)
+"T1 ="+STarget1+"\n"+EncodeColor(colorLightOrange) +"T2 ="+STarget2+"","");
//------------------------------------------------------------------------

copy-paste blue color texts in formula editor
Thank you.
 

Similar threads

Broker Special Offers