| 
 PureBytes Links 
Trading Reference Links 
 | 
This function is 
handy to measure the price difference between two points, click on the first and 
then the second and read the difference. I use it to get an idea of 
indicator profitability by clicking on various points on my charts. It 
works under Real Time Refresh conditions. You can modify this to work 
horizontally to measure distances between bars.
<SPAN 
class=250152519-26072004> 
Best 
Regards,
<SPAN 
class=250152519-26072004>herman
Plot<FONT 
color=#0000ff>(C,"",1,128);function<FONT 
color=#0000ff size=2> PlotHorCursorClicks( Price )<SPAN 
class=250152519-26072004>    {<SPAN 
class=250152519-26072004>    CurrentPrice = SelectedValue( 
Price );    
if(IsEmpty(StaticVarGet("PrevPrice"))) <SPAN 
class=250152519-26072004>    
StaticVarSet("PrevPrice",CurrentPrice);<SPAN 
class=250152519-26072004>    
if(IsEmpty(StaticVarGet("CurrentPrice"))) 
StaticVarSet("CurrentPrice",CurrentPrice);<SPAN 
class=250152519-26072004>    PrevPrice = 
StaticVarGet("PrevPrice");<SPAN 
class=250152519-26072004>    if( CurrentPrice!= 
PrevPrice) <SPAN 
class=250152519-26072004>        
{<SPAN 
class=250152519-26072004>        
StaticVarSet("PrevPrice",CurrentPrice);<SPAN 
class=250152519-26072004>        
StaticVarSet("CurrentPrice", PrevPrice );<SPAN 
class=250152519-26072004>        
}
<SPAN 
class=250152519-26072004>    CurrentPrice= 
StaticVarGet("CurrentPrice");<SPAN 
class=250152519-26072004>    PrevPrice = 
StaticVarGet("PrevPrice");    
PriceChange = PrevPrice - CurrentPrice;<SPAN 
class=250152519-26072004>    
Plot(CurrentPrice,"\n\nPrevPrice: ",4,1);<SPAN 
class=250152519-26072004>    Plot(PrevPrice, "\nLastPrice: 
",5,1);    
Plot(PriceChange ,"\nPriceChange: 
",1,styleNoLine|styleNoLabel|styleNoRescale);<SPAN 
class=250152519-26072004>    <FONT 
size=2>return 
CurrentPrice;<SPAN 
class=250152519-26072004>    }
PlotHorCursorClicks( C );<FONT 
face="Lucida Console"> // You can substitute 
another price array for C
<SPAN 
class=250152519-26072004> 
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
  ADVERTISEMENT 
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
 |