PureBytes Links
Trading Reference Links
|
It is one plotting green dot line, style number 4+8
Try removing the plot lines one at a time to see which one
is plotting zeroes. It may need a Null to hide it when zero
<font size=3 color=teal
face="Times New Roman">Cheers,
Graham
<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/ASXShareTrading
<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/FMSAustralia
<span
>-----Original Message-----
From: Steve Almond (F)
[mailto:steve@xxxxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, 30 April 2003
6:19 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Graph
plots using loops
<font size=2
face="Times New Roman">
<font size=2
face="Times New Roman">Great plot! One problem I
have is that on many charts I show a green 'nobbly' line at zero (see
attached). This compresses the rest of the chart. Is there a way to avoid this?
I couldn't see anything obvious in the code.
<font size=2
face="Times New Roman">
<font size=2
face="Times New Roman">Thanks,
<font size=2
face="Times New Roman">
<font size=2
face="Times New Roman">Steve
<span
>----- Original Message -----
<font
size=2 face=Arial>From: <a
href="" title="listes.trading@xxxxxxx">Listes
trading
<span
>To:<font
face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">AmiBroker
<span
>Sent:<font
face=Arial> Wednesday, April 30, 2003 9:43 AM
<span
>Subject:<font
face=Arial> [amibroker] Graph plots using loops
<font size=2
face="Times New Roman">
<font size=2 color=navy
face="Times New Roman">Hello
<font size=2
face="Times New Roman">
<font size=2 color=navy
face="Times New Roman">Here is a
simple code that uses a "for" loop to plot
last supports, resistances and open gaps on a candlestick chart.
<font size=2
face="Times New Roman">
<span
>Bars = <font
color=mediumseagreen>param<font
color=blue>(<span
>"Bars"<span
>,50,<font
color="#282828">10<span
>,500,<font
color="#282828">10<span
>);
<span
>NN = <font
color=mediumseagreen>param<font
color=blue>(<span
>"Number of items to plot"<font
color=blue>,<span
>5,<font
color="#282828">5<span
>,100,<font
color="#282828">1<span
>);
<span
>pc = <span
>5*<font
color=mediumseagreen>LastValue<font
color=blue>((<span
>HHV<span
>(H<font
color=blue>,Bars)-<font
color=mediumseagreen>LLV<font
color=blue>(<span
>L,Bars))/<font
color=mediumseagreen>MA<font
color=blue>(<span
>C,Bars));
<span
>x0 = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>Cum<span
>(1));
<span
>Colorgapup = <span
>colorGreen<span
>;
<span
>Colorgapdown = <font
color=red>colorRed<span
>;
<span
>Colorsupport = <font
color=red>colorSeaGreen<span
>;
<span
>Colorresistance = <font
color=red>colorLightOrange<font
color=blue>;
<span
>title<span
> = "Candlestick chart with supports, resistances and open gaps /
"+ <font
color=mediumseagreen>fullname<font
color=blue>();
<span
>graphxspace<span
> = <span
>1;
<font size=2 color=mediumseagreen
face="Times New Roman">plot<font
color=blue>(<span
>C,<font
color=fuchsia>""<font
color=blue>,<span
>colorblack<span
>,stylecandle<font
color=blue>);
<font size=2 color=mediumseagreen
face="Times New Roman">plot<font
color=blue>(<span
>bbandbot<span
>((H<font
color=blue>+<span
>L)/<font
color="#282828">2<span
>,20,<font
color="#282828">2<span
>),""<font
color=blue>,<span
>colorlightblue<span
>,stylenolabel<font
color=blue>);
<font size=2 color=mediumseagreen
face="Times New Roman">plot<font
color=blue>(<span
>bbandtop<span
>((H<font
color=blue>+<span
>L)/<font
color="#282828">2<span
>,20,<font
color="#282828">2<span
>),""<font
color=blue>,<span
>colorlightblue<span
>,stylenolabel<font
color=blue>);
<span
>for<span
>(i=<span
>1;
i<NN+1<font
color=blue>; i++)
<span
>{
<font size=2 color="#a52a00"
face="Times New Roman">// Resistances
<span
>yb = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>Trough<span
>(L<font
color=blue>,pc,i));
<span
>xb = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>TroughBars<span
>(L<font
color=blue>,pc,i));
<span
>resistance = <font
color=mediumseagreen>IIf<font
color=blue>(<span
>Cum<span
>(1)>=x0-xt+<font
color="#282828">1<span
>,yt,-<span
>1e10<span
>);
<font size=2 color="#a52a00"
face="Times New Roman">// Supports
<span
>yt = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>Peak<span
>(H<font
color=blue>,pc,i));
<span
>xt = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>PeakBars<span
>(H<font
color=blue>,pc,i));
<span
>support = <font
color=mediumseagreen>IIf<font
color=blue>(<span
>Cum<span
>(1)>=x0-xb+<font
color="#282828">1<span
>,yb,-<span
>1e10<span
>);
<font size=2 color="#a52a00"
face="Times New Roman">// Open gaps up
<span
>xgapup = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>ValueWhen<span
>(<span
>GapUp<span
>(),<span
>Cum<span
>(1),i));
<span
>ygapup = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>ValueWhen<span
>(<span
>GapUp<span
>(),<span
>Ref<span
>(H<font
color=blue>,-<span
>1),i));
<span
>ygapup = <font
color=mediumseagreen>IIf<font
color=blue>(<span
>LastValue<span
>(<span
>LLV<span
>(L<font
color=blue>,x0-xgapup+<font
color="#282828">1<span
>))<=ygapup,-<span
>1e10<span
>,ygapup);
<span
>ygapup = <font
color=mediumseagreen>IIf<font
color=blue>(<span
>Cum<span
>(1)>=xgapup,ygapup,-<font
color="#282828">1e10<span
>);
<font size=2 color="#a52a00"
face="Times New Roman">// Open gaps down
<span
>xgapdn = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>ValueWhen<span
>(<span
>GapDown<span
>(),<span
>Cum<span
>(1),<font
color="#282828">1<span
>));
<span
>ygapdn = <font
color=mediumseagreen>LastValue<font
color=blue>(<span
>ValueWhen<span
>(<span
>GapDown<span
>(),<span
>Ref<span
>(L<font
color=blue>,-<span
>1),<font
color="#282828">1<span
>));
<span
>ygapdn = <font
color=mediumseagreen>IIf<font
color=blue>(<span
>LastValue<span
>(<span
>HHV<span
>(H<font
color=blue>,x0-xgapdn +<font
color="#282828">1<span
>))>=ygapdn ,-<span
>1e10<span
>,ygapdn );
<span
>ygapdn = <font
color=mediumseagreen>IIf<font
color=blue>(<span
>Cum<span
>(1)>=xgapdn
,ygapdn ,-1e10<font
color=blue>);
<font size=2 color="#a52a00"
face="Times New Roman">// Graph plots
<font size=2 color=mediumseagreen
face="Times New Roman">Plot<font
color=blue>(ygapdn ,<span
>""<span
>,Colorgapdown ,<span
>4+<font
color="#282828">8<span
>);
<font size=2 color=mediumseagreen
face="Times New Roman">Plot<font
color=blue>(ygapup,<span
>""<span
>,Colorgapup ,<span
>4+<font
color="#282828">8<span
>);
<font size=2 color=mediumseagreen
face="Times New Roman">Plot<font
color=blue>(support,<span
>""<span
>,Colorsupport ,<span
>4);
<font size=2 color=mediumseagreen
face="Times New Roman">Plot<font
color=blue>(resistance,<font
color=fuchsia>""<font
color=blue>,Colorresistance ,<font
color="#282828">4<span
>);
<span
>}
<font size=2
face="Times New Roman">
Send BUG REPORTS to
bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.
<font size=2
face="Times New Roman">
Send
BUG REPORTS to bugs@xxxxxxxxxxxxx<span
>
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|