PureBytes Links
Trading Reference Links
|
Hello,
An easier solution would be using BeginValue and
EndValue functions
<A
href="">http://www.amibroker.com/f?beginvalue
<A
href="">http://www.amibroker.com/f?endvalue
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Herman van den
Bergen
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">AmiBroker YahooGroups
Sent: Monday, July 26, 2004 9:48 PM
Subject: [amibroker] StaticVar
Application: Measure price changes between clicks
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 );<SPAN
class=250152519-26072004>
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");<SPAN
class=250152519-26072004> PriceChange = PrevPrice -
CurrentPrice;
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:<A
href="">http://www.amibroker.com/Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
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.
|