PureBytes Links
Trading Reference Links
|
Try
#include <writeupnstock.afl>
Also I think you should show AmiBroker where your
include directory resides. Not sure as I have not used any # include type
of formulas.
Prashanth
<BLOCKQUOTE dir=ltr
>
----- Original Message -----
<DIV
>From:
mrdavis9
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Friday, April 16, 2004 9:57
AM
Subject: [amibroker] Modify Price
Chart
Thanks for the suggestions. My builtin price
chart has
<FONT color=#800000
size=4>#include <FONT
color=#ff00ff size=4>"C:\\program
files\amibroker\afl\include\writeuponstock.afl"<FONT
color=#000000>;
and I tried using
<SPAN
>#include "C:\program
files\amibroker\afl\include\writeuponstock.afl", and
, Progra~1 , and neither of them
worked.
<SPAN
><FONT
size=2>
<SPAN
>I am pretty sure
that I would overheat my brain once again if I tried to learn
all about WriteIf. Also,from what I read in
Help, WriteIf() would be of no use in getting <FONT
size=4>,<SPAN
>"BwidthPctChg",to appear in the
popup menu.
<SPAN
><FONT
size=4>
<SPAN
>Further, I found
nothing in help about modifying built-in indicators. I looked at past posts of
how to add to the builtin indicators, and none of them even mentioned the
popup menu.
<SPAN
><FONT
size=4>
<SPAN
>Does anyone have
other ideas of how to make the builtin popup menus display additional
information? Ron D
<SPAN
><SPAN
>
<SPAN
><SPAN
>===============================================================================
<SPAN
><SPAN
>
----- Original Message -----
<BLOCKQUOTE
>
<DIV
>From:
<A title=prash454@xxxxxxxxxxxxxxxxx
href="">Prashanth
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, April 13, 2004 10:50
PM
Subject: Re: [amibroker] Re: Modify
Price Chart
If it does not work even after
doing what graham has said below, try changing Program files to
Progra~1
Regards
Prashanth
<BLOCKQUOTE dir=ltr
>
----- Original Message -----
<DIV
>From:
<A title=gkavanagh@xxxxxxxxxxxxx
href="">Graham
To: <A
title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Wednesday, April 14, 2004 3:01
AM
Subject: RE: [amibroker] Re: Modify
Price Chart
<SPAN
>#include "C:\program
files\amibroker\afl\include\writeuponstock.afl"
<SPAN
>the double dash at the start
C:\\
<SPAN
>
<SPAN
>Cheers,Graham<A
href="">http://e-wire.net.au/~eb_kavan/
<FONT face=Tahoma
size=2>-----Original
Message-----From:
mrdavis9 [mailto:mrdavis9@xxxxxxxxxx] <SPAN
>Sent: Wednesday, April 14, 2004 4:45
AMTo: <A
href="">amibroker@xxxxxxxxxxxxxxx<SPAN
>Subject: Re: [amibroker] Re: Modify
Price Chart
<FONT face="Times New Roman"
size=2>
<SPAN
>If any of you feel free to
tell me what I did wrong below, I will appreciate
it. I have never succeeded in modifying any of the
builtin AB indicators. Ron D
<SPAN
>Johan, thanks for the
code. I made a custom version of the built-in price chart so I would
not risk harming the built-in price chart. Below, I have copied the
custom duplicate Price Chart, with your code pasted in above
the<SPAN
>
//--Indicator-End-- <FONT face=Arial color=black
size=4><SPAN
>line as you
instructed. I have also copied the error message that I get when I
click on Apply.
<SPAN
>I then clicked
on OK after viewing the error message, and this same error message is
the only thing that shows up in the indicator window. Somehow, this
added coding prevents the original portion of the built-in price window
from seeing whatever else that it needs to see.
<SPAN
>I looked in help for
WRITEUPONSTOCK but could find no reference to it.. I am
guessing that it would work if it were coded using
WriteIf( xxxxxxx). I will try to learn a little about this when I
have more time.
<SPAN
> Ron
D
<SPAN
>This is the error below.
<SPAN
>=======================================================
<SPAN
>Line 20, Column 69://
(C)2002 amibroker.com
<SPAN
>#include "C:\\program
files\amibroker\afl\include\writeuponstock.afl"--------------------------------------------------------------------^
<SPAN
>#include error: File does not
exist:'C:\\program
files\amibroker\afl\include\writeuponstock.afl'(current working
directory is 'C:\Program Files\AmiBroker')
<SPAN
>This is the pasted version
done in a Custom Indicator window,
<SPAN
>===============================================================================
<SPAN
>btop = <FONT
color=blue>BBandTop( <SPAN
>C, <SPAN
>Prefs( <SPAN
>4 ), <SPAN
>Prefs(<SPAN
>8)/<SPAN
>100 );
<SPAN
>bbot = <FONT
color=blue>BBandBot( <SPAN
>C, <SPAN
>Prefs(<SPAN
>4), <SPAN
>Prefs(<SPAN
>8)/<SPAN
>100 );
<SPAN
>width = btop -
bbot;
<SPAN
>PctChange=<FONT
color=fuchsia>100*(width-<FONT
color=blue>Ref(width,-<FONT
color=fuchsia>1))/<FONT
color=blue>Ref(width,-<FONT
color=fuchsia><SPAN
>1);
<SPAN
>Plot<FONT
face=Arial size=4><SPAN
>(PctChange,<FONT
color=fuchsia><SPAN
>"BwidthPctChg",<SPAN
>colorBlack,<SPAN
>styleNoDraw);
<SPAN
>//--Indicator-End--
<SPAN
>// Above line
instructs the parser that the code
<SPAN
>// below is
only for commentary/interpretation window
<SPAN
>// This
provides significant performance improvement
<SPAN
>//
<SPAN
>// (C)2002
amibroker.com
<SPAN
>#include<FONT
face=Arial size=4>
"C:\\program
files\amibroker\afl\include\writeuponstock.afl";
<SPAN
>movshort = <FONT
color=blue>MA( <SPAN
>C, <SPAN
>Prefs(<SPAN
>4) );
<SPAN
>movmed = <FONT
color=blue>MA( <SPAN
>C, <SPAN
>Prefs(<SPAN
>6) );
<SPAN
>movlong = <FONT
color=blue>MA( <SPAN
>C, <SPAN
>Prefs(<SPAN
>28) );
<SPAN
>btop = <FONT
color=blue>BBandTop( <SPAN
>C, <SPAN
>Prefs( <SPAN
>4 ), <SPAN
>Prefs(<SPAN
>8)/<SPAN
>100 );
<SPAN
>bbot = <FONT
color=blue>BBandBot( <SPAN
>C, <SPAN
>Prefs(<SPAN
>4), <SPAN
>Prefs(<SPAN
>8)/<SPAN
>100 );
<SPAN
>width = btop -
bbot;
<SPAN
>lslop = <FONT
color=blue>LinRegSlope( <SPAN
>C, <SPAN
>30 ) + <SPAN
>100;
<SPAN
>lslo = <FONT
color=blue>LLV( lslop, <FONT
color=fuchsia>90
);
<SPAN
>lshi = <FONT
color=blue>HHV( lslop, <FONT
color=fuchsia>90
);
<SPAN
>lswidth = lshi -
lslo;
<SPAN
>trend = <FONT
color=fuchsia>100*( lslop -
lslo )/lswidth;
<SPAN
>mawidth = <FONT
color=blue>MA( width, <FONT
color=fuchsia>100
);
<SPAN
>relwidth = <FONT
color=fuchsia>100*(width -
mawidth)/mawidth;
<SPAN
>_N<FONT
face=Arial size=4>(
tname = <SPAN
>Name()+<SPAN
>"("+<SPAN
>FullName()+<SPAN
>")" );
<SPAN
>"Price and
moving averages:"<SPAN
>;
<SPAN
>tname + <FONT
color=fuchsia>" has closed " +
WriteIf( <SPAN
>C > movshort, <FONT
color=fuchsia>"above" , <FONT
color=fuchsia>"below" ) + <FONT
color=fuchsia>" its short time moving
average. ";
<SPAN
>"Short time
moving average is currently "<SPAN
> + <SPAN
>WriteIf( movshort > movmed, <FONT
color=fuchsia>"above", <FONT
color=fuchsia>"below") + <FONT
color=fuchsia>" mid-time, and "
+ WriteIf(
movshort > movlong, <SPAN
>"above", <SPAN
>"below" ) + <SPAN
>" long time moving
averages.";
<SPAN
>"The
relationship between price and moving averages is: "<FONT
face=Arial size=4><SPAN
>+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
C > movshort <SPAN
>AND movshort > movmed, <FONT
color=fuchsia><SPAN
>"bullish",
<SPAN
>WriteIf<FONT
face=Arial size=4>(
C < movshort <SPAN
>AND movshort < movmed, <FONT
color=fuchsia>"bearish", <FONT
color=fuchsia>"neutral" ) ) +
" in short-term, and
"+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
movshort > movmed AND
movmed > movlong , <SPAN
>"bullish",
<SPAN
>WriteIf<FONT
face=Arial size=4>(
movshort < movmed AND
movmed < movlong, <SPAN
>"bearish", <SPAN
>"neutral" ) ) + <FONT
color=fuchsia>" in mid-long term.
";
<SPAN
>"\nBollinger
Bands:"<SPAN
>;
<SPAN
>tname+ <FONT
color=fuchsia>" has closed " +
<SPAN
>WriteIf<FONT
face=Arial size=4>(
C < bbot, <FONT
color=fuchsia>"below the lower band by
" +
<SPAN
>WriteVal<FONT
face=Arial size=4>(
100 *(
bbot-C )/ width, <FONT
color=fuchsia>1.1 ) + <FONT
color=fuchsia>"%. "
+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
trend < <SPAN
>30, <SPAN
>" This combined with the steep downtrend can
suggest that the downward trend in prices has a good chance of continuing.
However, a short-term pull-back inside the bands is
likely.",
<SPAN
>WriteIf<FONT
face=Arial size=4>(
trend > <SPAN
>30 <SPAN
>AND trend < <FONT
color=fuchsia>70, <FONT
color=fuchsia>"Although prices have broken
the lower band and a downside breakout is possible, the most likely
scenario for "+tname+<SPAN
>" is to continue within current trading
range.", <SPAN
>"" ) ), <SPAN
>"" ) +
<SPAN
>WriteIf<FONT
face=Arial size=4>(
C > btop, <FONT
color=fuchsia>"above the upper band by
" +
<SPAN
>WriteVal<FONT
face=Arial size=4>(
100 *(
C- btop )/ width, <FONT
color=fuchsia>1.1 ) + <FONT
color=fuchsia>"%. "
+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
trend > <SPAN
>70, <SPAN
>" This combined with the steep uptrend suggests
that the upward trend in prices has a good chance of continuing. However,
a short-term pull-back inside the bands is
likely.",
<SPAN
>WriteIf<FONT
face=Arial size=4>(
trend > <SPAN
>30 <SPAN
>AND trend < <FONT
color=fuchsia>70, <FONT
color=fuchsia>"Although prices have broken
the upper band and a upside breakout is possible, the most likely scenario
for "+tname+<SPAN
>" is to continue within current trading
range.", <SPAN
>"" ) ), <SPAN
>"" ) +
<SPAN
>WriteIf<FONT
face=Arial size=4>(
C < btop <SPAN
>AND ( ( btop - <SPAN
>C ) / width ) < <FONT
color=fuchsia>0.5,
<SPAN
>"below upper
band by "<SPAN
> +
<SPAN
>WriteVal<FONT
face=Arial size=4>(
100 *( btop
- C )/ width, <FONT
color=fuchsia>1.1 ) + <FONT
color=fuchsia>"%. ",
<SPAN
>WriteIf<FONT
face=Arial size=4>(
C < btop <SPAN
>AND <SPAN
>C > bbot , <FONT
color=fuchsia>"above bottom band by
" +
<SPAN
>WriteVal<FONT
face=Arial size=4>(
100 *(
C - bbot )/ width, <FONT
color=fuchsia>1.1 ) + <FONT
color=fuchsia>"%. ", <FONT
color=fuchsia>"" )
);
<SPAN
>WriteIf<FONT
face=Arial size=4>( (
trend > <SPAN
>30 <SPAN
>AND trend < <FONT
color=fuchsia>70 <SPAN
>AND ( <SPAN
>C > btop <SPAN
>OR <SPAN
>C < bbot ) ) <SPAN
>AND <SPAN
>abs(relwidth) > <FONT
color=fuchsia><SPAN
>40,
<SPAN
>"This
picture becomes somewhat unclear due to the fact that Bollinger Bands are
currently"<SPAN
>,
<SPAN
>"Bollinger
Bands are "<SPAN
> )+
<SPAN
>WriteVal<FONT
face=Arial size=4>(
abs( relwidth ),
1.1 ) +
"% "
+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
relwidth > <SPAN
>0, <SPAN
>"wider" , <SPAN
>"narrower" ) +
<SPAN
>" than
normal."<SPAN
>;
<SPAN
>WriteIf<FONT
face=Arial size=4>(
abs( relwidth )
< 40,
"The current width of the
bands (alone) does not suggest anything conclusive about the future
volatility or movement of prices.",<SPAN
>"")+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
relwidth < -<SPAN
>40, <SPAN
>"The narrow width of the bands suggests low
volatility as compared to " + tname + <FONT
color=fuchsia>"'s normal range. Therefore,
the probability of volatility increasing with a sharp price move has
increased for the near-term. "+
<SPAN
>"The bands
have been in this narrow range for "<FONT face=Arial
size=4> + <FONT
color=blue>WriteVal(<FONT
color=blue>BarsSince(<FONT
color=blue>Cross(-<FONT
color=fuchsia><SPAN
>40,relwidth)),<FONT
color=fuchsia>1.0) + <FONT
color=fuchsia>" bars. The probability of a
significant price move increases the longer the bands remain in this
narrow range." ,<SPAN
>"")+
<SPAN
>WriteIf<FONT
face=Arial size=4>(
relwidth > <SPAN
>40, <SPAN
>"The large width of the bands suggest high
volatility as compared to " + tname + <FONT
color=fuchsia>"'s normal range. Therefore,
the probability of volatility decreasing and prices entering (or remaining
in) a trading range has increased for the near-term.
"+
<SPAN
>"The bands
have been in this wide range for "<FONT face=Arial
size=4> + <FONT
color=blue>WriteVal(<FONT
color=blue>BarsSince(<FONT
color=blue>Cross(relwidth,<FONT
color=fuchsia>40)),<FONT
color=fuchsia>1.0) + <FONT
color=fuchsia>" bars.The probability of
prices consolidating into a less volatile trading range increases the
longer the bands remain in this wide range." ,<FONT
color=fuchsia><SPAN
>"");
<SPAN
>"\nThis
commentary is not a recommendation to buy or sell. Use at your own
risk."<SPAN
>;
<SPAN
>
<SPAN
>===========================================================================
<FONT face="Times New Roman"
size=2>----- Original Message -----
<BLOCKQUOTE
>
<P class=MsoNormal
><FONT face=Arial
size=2><SPAN
>From:<FONT
face=Arial> <A
title=johanskatt@xxxxxxxx href="">johsun
<FONT face=Arial
size=2><SPAN
>To:<FONT
face=Arial> <A
title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
<FONT face=Arial
size=2><SPAN
>Sent:<FONT
face=Arial> Tuesday, April 13, 2004
2:32 PM
<FONT face=Arial
size=2><SPAN
>Subject:<FONT
face=Arial> [amibroker] Re: Modify
Price Chart
<FONT
face="Times New Roman" size=2><SPAN
>
<FONT
face="Times New Roman" size=2><SPAN
>Hello,just past the code below (I made
some changes to the plot statement)*above* the first line in main
price chart code, the one that says
//--Indicator-End--.btop = BBandTop( C, Prefs( 4 ), Prefs(8)/100
);bbot = BBandBot( C, Prefs(4), Prefs(8)/100 );width =
btop -
bbot;PctChange=100*(width-Ref(width,-1))/Ref(width,-1);Plot(PctChange,"BwidthPctChg",colorBlack,styleNoDraw);Johan---
In <A
href="">amibroker@xxxxxxxxxxxxxxx,
"mrdavis9" <mrdavis9@x...>
wrote:> All I really want to do is to add to the built-in Price
Chart popup menu so that it will show this "BwidthPctChg" value at
the bottom of the menu.> > I have never tried to
modify the main price chart. I looked at the coding in
it, and it is way beyond what I do right now. I have other
things I am working on right now, so I don't want to stop what I am
doing in order to learn all about the coding in the price chart. It
appears that you are supposed to somehow make the output from all of
those WriteIf(statements) appear in the commentary window,
which I have yet to feel the need to use.> > I copied the
built-in price code to a custom indicator, deleted most of it, and
then added the below modification to it, and it works, but I would
sure like to have this function available in the built-in price
chart. BTW, in this custom version, the Bollinger bands
ended up being super close together, even before I multiplied by 100
for the last plot(statement).> > I sure would appreciate
it if a kind soul would post the completed modification, and
instruct me how to install it into the main price chart so that it
will appear in the popup menu. I assume it involves those
writeif() functions that I see in the code, which I have also never
used. later, Ron D> > movshort = MA( C, Prefs(4)
);> > movmed = MA( C, Prefs(6) );> > movlong
= MA( C, Prefs(28) );> > btop = BBandTop( C, Prefs( 4 ),
Prefs(8)/100 );> > bbot = BBandBot( C, Prefs(4),
Prefs(8)/100 );> > width = btop - bbot;> >
PctChange=(width-Ref(width,-1))/Ref(width,-1);> >
Plot(btop,"Btop",colorBlack,styleLine);> >
Plot(bbot,"Bbot",colorBlack,styleLine);> >
Plot(width,"Bwidth",colorBlack,styleNoLine,styleOwnScale);>
>
Plot(PctChange*100,"BwidthPctChg",colorBlack,styleNoLine,styleOwnScale);>
> > > > ---> Outgoing mail is
certified Virus Free.> Checked by AVG anti-virus system (<A
href="">http://www.grisoft.com).>
Version: 6.0.656 / Virus Database: 421 - Release Date:
4/10/2004------------------------ Yahoo! Groups Sponsor
---------------------~-->Buy Ink Cartridges or Refill Kits for
your HP, Epson, Canon or LexmarkPrinter at MyInks.com. Free
s/h on orders $50 or more to the US & Canada.<A
href="">http://www.c1trackingcom/l.asp?cid=5511<A
href="">http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM---------------------------------------------------------------------~->Send
BUG REPORTS to <A
href="">bugs@xxxxxxxxxxxxxSend
SUGGESTIONS to <A
href="">suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: <A
href="">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
Yahoo! Groups Links<*> To visit your group on the web,
go to: <A
href="">http://groups.yahoo.com/group/amibroker/<*>
To unsubscribe from this group, send an email
to: <A
href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx<*>
Your use of Yahoo! Groups is subject to: <A
href="">http://docs.yahoo.com/info/terms/
<FONT
face="Times New Roman" size=2><SPAN
>
<FONT
face="Times New Roman" size=2><SPAN
>---Outgoing mail is certified Virus
Free.Checked by AVG anti-virus system (<A
href="">http://www.grisoft.com).Version:
6.0.656 / Virus Database: 421 - Release Date:
4/10/2004
<FONT face="Times New Roman"
size=2><FONT
face="Courier New">Send BUG REPORTS to bugs@xxxxxxxxxxxxx<FONT
face="Courier New"><FONT
face="Courier New">Send SUGGESTIONS to
suggest@xxxxxxxxxxxxx<FONT
face="Courier New">-----------------------------------------<FONT
face="Courier New">Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx (Web
page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT
face="Courier New">--------------------------------------------<FONT
face="Courier New">Check group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend
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
Send BUG REPORTS to
bugs@xxxxxxxxxxxxxSend 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
Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend
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
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
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.
|