Skip to main content

Title and pivot for Amibroker (AFL)

jaipal7786 over 13 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker

Title some attractive and advance feature only copy paste below buy/sell
in any AFL and first previous title remove or hide with // and after
paste look like good feel your title with pivot…..enjoy your happy trading all….

Indicator / Formula

Copy & Paste Friendly
Cover=Buy;
Short=Sell;
//Plot(C,"",4,64);
_SECTION_BEGIN("Tops and bottom");
Long=Flip(Buy,Sell);
Shrt=Flip(Short,Cover);
Edc=(
WriteIf (Buy AND Ref(shrt,-1), " BUY @ "+C+"  ","")+ 
WriteIf (Sell AND Ref(Long,-1), " SEll @ "+C+"  ","")+
WriteIf(Sell , "Last Trade Profit Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy  , "Last Trade Profit Rs."+(SellPrice-C)+"",""));

//============== TITLE ==============


pd = Param("Periods",13,5,144,1); 
pds = 2*pd-1;//     (Adjustment for Wilders MA) 
aa = Close-Ref(Close,-1); 
uu = EMA(Max(0,aa),pds); 
dd=  EMA((Max(0,0-aa)),pds); 

rf = IIf(C>2,1000,10000); 

c1 = Param("Upper Level",70,50,90,1); 
qq1 =100/(100-c1)-1; 
ff1 = qq1*dd-uu; 
ff2 = ff1/qq1; 
f1 = Max(ff1,ff2); 
UL = Close + f1*(pds-1)/2; 
UL = IIf(UL>C,floor(UL*rf),ceil(UL*rf))/rf; 

c2 = Param("Equilibrium",50,50,50,0);  
qq2 =100/(100-c2)-1;// [=1] 
ff = dd-uu; 
MM = Close + ff*(pds-1)/2; 
MM = IIf(MM>C,floor(MM*rf),ceil(MM*rf))/rf; 

c3 = Param("Lower Level",30,10,50,1); 
qq3 =100/(100-c3)-1; 
ff1 = qq3*dd-uu; 
ff2 = ff1/qq3; 
f3 = Min(ff1,ff2); 
LL = Close + f3*(pds-1)/2; 
LL = IIf(LL>C,floor(LL*rf),ceil(LL*rf))/rf; 

band = Param("band width",4,0,15,0.25);
mmu = MM+band;
mmd = MM-band;

_SECTION_BEGIN("Pivot calc");

TimeFrameSet( in15Minute*2 ); 
DH=Ref(H,-1); 
DL=Ref(L,-1);
DC=Ref(C,-1);


pd = ( DH+ DL + DC )/3;
sd1 = (2*pd)-DH;
sd2 = pd -(DH - DL);
sd3 = Sd1 - (DH-DL); 
rd1 = (2*pd)-DL;
rd2 = pd +(DH -DL);
rd3 = rd1 +(DH-DL);



_SECTION_BEGIN("Title");
no=Param( "Swing", 6, 1, 55 );
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);
dec = (Param("Decimals",2,0,7,1)/10)+1;
if( Status("action") == actionIndicator ) 
(
Title = EncodeColor(55)+  Title = Name() + "     " + EncodeColor(32) + Date() +
"      " + EncodeColor(5) + "{{INTERVAL}}  " +
	EncodeColor(55)+ "     Open = "+ EncodeColor(52)+ WriteVal(O,dec) + 
	EncodeColor(55)+ "     High = "+ EncodeColor(5) + WriteVal(H,dec) +
	EncodeColor(55)+ "      Low = "+ EncodeColor(32)+ WriteVal(L,dec) + 
	EncodeColor(55)+ "    Close = "+ EncodeColor(52)+ WriteVal(C,dec)+
	EncodeColor(55)+ "    Volume = "+ EncodeColor(52)+ WriteVal (V ,1.25)




+"\n"+EncodeColor(colorBrightGreen)+

WriteIf (Buy , "Signal: Go Long - Entry Price: "+WriteVal(C)+" - Traget: "+WriteVal((BuyPrice-tsl)+BuyPrice)

+" - StopLoss:"+WriteVal(tsl)+"  "

,"")+

"\n"+EncodeColor(colorRed)+
WriteIf (Sell , "Signal: Go Short - Entry Price: "+WriteVal(C)+" - Target: "+WriteVal((tsl-SellPrice)-SellPrice)+" - StopLoss:"+WriteVal(tsl)+" ","")+
EncodeColor(colorTurquoise)+
WriteIf(Long AND NOT Buy, "Trade: Long - Entry Price: "+WriteVal((BuyPrice))+" - Profit: "+WriteVal((C-BuyPrice))+" "+EncodeColor(colorLime)+"Let your profit runs!","")+
EncodeColor(colorLightOrange)+
WriteIf(shrt AND NOT Sell, "Trade: Short - Entry Price: "+WriteVal((SellPrice))+" - Profit: "+WriteVal((SellPrice-C))+"  - "+EncodeColor(colorLime)+"Let your profit runs!","")+

EncodeColor(colorBrightGreen)+   "


\n R3 : "+ 
EncodeColor(colorWhite)+RD3+ 
EncodeColor(colorBrightGreen)+   "\n R2 : "+ 
EncodeColor(colorWhite)+RD2+ 
EncodeColor(colorBrightGreen)+   "\n R1 : " +
EncodeColor(colorWhite)+RD1 + 
EncodeColor(colorBrightGreen)+  "     UP TGT   : "+ 
EncodeColor(colorWhite)+UL+ 
EncodeColor(colorBlue)+   "\n Pivot : "+
EncodeColor(colorWhite)+pd+ 
EncodeColor(colorBlue)+   "    MIDPOINT : "+ 
EncodeColor(colorWhite)+MM+ 
EncodeColor(colorRed)+   "\n S1 : "+ 
EncodeColor(colorWhite)+SD1   + 
EncodeColor(colorRed)+    "     BOT TGT  : "+ 
EncodeColor(colorWhite)+LL+ 
EncodeColor(colorRed)+   "\n S2 : "+ 
EncodeColor(colorWhite)+SD2+ 
EncodeColor(colorRed)+   "\n S3 : "+ 
EncodeColor(colorWhite)+SD3
);
_SECTION_END();

4 comments

3. Suren
over 13 years ago

Jaipal,

Can you post the complete error free AFL?

Thanks in advance

Suren

over 13 years ago

suren read this again

Title some attractive and advance feature only copy paste below buy/sell
in any AFL and first previous title remove or hide with // and after
paste look like good feel your title with pivot…..enjoy your happy trading all….

Leave Comment

Please login here to leave a comment.