Try this if it works for you | may be i am wrong that you want
_SECTION_BEGIN("Price-Volume Change 
%");PlotOHLC(Open,High,Low,Close,"",IIf(Close>Open, colorBrightGreen,colorRed), 
styleCandle);
//price 
selectiononedy=Param("Day",1,1,100,1);pronedybfr=LastValue(Ref(C,-onedy));prccngonedy=LastValue(C)-pronedybfr;pronedyttlCngPrcntg=prccngonedy*100/LastValue(C);
//volume 
selectionVoonedybfr=LastValue(Ref(V,-onedy));Vocngonedy=LastValue(V)-Voonedybfr;voonedyttlcngprcntg=Vocngonedy*100/LastValue(V);

Title 
=Name()+"\n"+"Open:"+LastValue(O)+"\n"+"Close:"+LastValue(C)+"\n"+"High:"+LastValue(H)+"\n"+"Low:"+LastValue(L)+"\n"+EncodeColor(colorWhite)+
 "Price Changed "+Onedy+": "+ 
EncodeColor(IIf(pronedyttlcngprcntg>0,colorGreen,colorRed)) 
+pronedyttlcngprcntg+"%"+"\n"+EncodeColor(colorWhite)+"Volume Changed "+Onedy+ 
": 
"+EncodeColor(IIf(voonedyttlcngprcntg>0,colorGreen,colorRed))+Voonedyttlcngprcntg+"%";
_SECTION_END();Buy=pronedyttlcngprcntg>1; //you can customize your value here 
instead of 1
regardsafzal


--- On Sun, 8/22/10, Meg Nath <[email protected]> wrote:

From: Meg Nath <[email protected]>
Subject: [amibroker] AFL Query
To: [email protected]
Date: Sunday, August 22, 2010, 8:22 AM















 
 



  


    
      
      
      
Hi All,

I was trying to generate an AFL which indicated buy signals when there is a 1% 
change b/w the close price of adjacent bars in an 1 minute chart. It worked in 
EOD data but failed in 1minute data please help. Code is written below! thanks 
in advance




_SECTION_BEGIN("Unnamed 17");
for(i=0;i<BarCount-1;i++)
{
a=Close[i];

b=Close[i+1];
Ca=b-a;
d=.01*a;
if(Ca>d)
{
Buy1=Close[i+1];
Buy=Buy1;
}
}
_SECTION_END();








    
     

    
    


 



  











      

Reply via email to