[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Param Question



PureBytes Links

Trading Reference Links










#include "C:\program files\amibroker\afl\include\writeuponstock.afl"

the double dash at the start C:\\

 



Cheers,
Graham
http://e-wire.net.au/~eb_kavan/ 



<span
>-----Original Message-----
From: mrdavis9
[mailto:mrdavis9@xxxxxxxxxx] 
Sent: Wednesday, April 14, 2004
4:45 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re:
Modify Price Chart

<font size=2
face="Times New Roman"> 



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

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-- <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.

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.  

  Ron D

This is the error below. <font size=4
face=Arial>=======================================================

Line 20, Column 69:
// (C)2002 amibroker.com

#include "C:\\program
files\amibroker\afl\include\writeuponstock.afl"
--------------------------------------------------------------------^

#include error: File does not exist:
'C:\\program files\amibroker\afl\include\writeuponstock.afl'
(current working directory is 'C:\Program Files\AmiBroker')

This is the pasted version done in a Custom Indicator
window,

===============================================================================

btop = BBandTop(
C, <span
>Prefs( <span
>4 ), <span
>Prefs(<span
>8)/<span
>100 );

bbot = BBandBot(
C, <span
>Prefs(<span
>4), <span
>Prefs(<span
>8)/<span
>100 );

width = btop - bbot;

PctChange=100*(width-Ref(width,-<font
color=fuchsia>1))/<span
>Ref(width,-<span
>1);

<span
>Plot<font
size=4 face=Arial>(PctChange,<font
color=fuchsia>"BwidthPctChg",<span
>colorBlack,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
size=4 face=Arial> <font
color=fuchsia>"C:\\program
files\amibroker\afl\include\writeuponstock.afl";

movshort = MA(
C, <span
>Prefs(<span
>4) );

movmed = MA(
C, <span
>Prefs(<span
>6) );

movlong = MA(
C, <span
>Prefs(<span
>28) );

btop = BBandTop(
C, <span
>Prefs( <span
>4 ), <span
>Prefs(<span
>8)/<span
>100 );

bbot = BBandBot(
C, <span
>Prefs(<span
>4), <span
>Prefs(<span
>8)/<span
>100 );

width = btop - bbot;

lslop = LinRegSlope(
C, <span
>30 ) + <span
>100;

lslo = LLV(
lslop, 90 );

lshi = HHV(
lslop, 90 );

lswidth = lshi - lslo;

trend = 100*(
lslop - lslo )/lswidth;

mawidth = MA(
width, 100 );

relwidth = <span
>100*(width - mawidth)/mawidth;

<span
>_N<font
size=4 face=Arial>( tname = <font
color=blue>Name()+<span
>"("+<span
>FullName()+<span
>")" );

<span
>"Price and moving
averages:";

tname + "
has closed " + WriteIf(
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, "above",
"below"
) + " long time moving
averages.";

<span
>"The relationship
between price and moving averages is: "<font size=4
face=Arial>+

<span
>WriteIf<font
size=4 face=Arial>( <span
>C > movshort AND movshort > movmed, <span
>"bullish",

<span
>WriteIf<font
size=4 face=Arial>( <span
>C < movshort AND movshort < movmed, <span
>"bearish", <span
>"neutral" ) ) + <font
color=fuchsia>" in short-term, and "+

<span
>WriteIf<font
size=4 face=Arial>( movshort
> movmed AND movmed >
movlong , "bullish",

<span
>WriteIf<font
size=4 face=Arial>( movshort
< movmed AND movmed <
movlong, "bearish",
"neutral"
) ) + " in mid-long term.
";

<span
>"\nBollinger
Bands:";

tname+ "
has closed " + 

<span
>WriteIf<font
size=4 face=Arial>( <span
>C < bbot, <span
>"below the lower band by " +

<span
>WriteVal<font
size=4 face=Arial>( <font
color=fuchsia>100 *( bbot-<span
>C )/ width, <span
>1.1 ) + <span
>"%. " +

<span
>WriteIf<font
size=4 face=Arial>( trend <
30, <font
color=fuchsia>" 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
size=4 face=Arial>( trend >
30 <span
>AND trend < <span
>70, <span
>"Although prices have broken the lower band and a
downside breakout is possible, the most likely scenario for "+tname+<font
color=fuchsia>" is to continue within current
trading range.", "" ) ), <span
>"" ) +

<span
>WriteIf<font
size=4 face=Arial>( <span
>C > btop, <span
>"above the upper band by " +

<span
>WriteVal<font
size=4 face=Arial>( <font
color=fuchsia>100 *( <span
>C- btop )/ width, <span
>1.1 ) + <span
>"%. " +

<span
>WriteIf<font
size=4 face=Arial>( trend >
70, <font
color=fuchsia>" 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
size=4 face=Arial>( trend >
30 <span
>AND trend < <span
>70, <span
>"Although prices have broken the upper band and a
upside breakout is possible, the most likely scenario for "+tname+<font
color=fuchsia>" is to continue within current
trading range.", "" ) ), <span
>"" ) +

<span
>WriteIf<font
size=4 face=Arial>( <span
>C < btop AND ( ( btop - C
) / width ) < 0.5,


<span
>"below upper band
by " +

<span
>WriteVal<font
size=4 face=Arial>( <font
color=fuchsia>100 *( btop - <span
>C )/ width, <span
>1.1 ) + <span
>"%. ", 

<span
>WriteIf<font
size=4 face=Arial>( <span
>C < btop AND C > bbot ,
"above bottom band by
" +

<span
>WriteVal<font
size=4 face=Arial>( <font
color=fuchsia>100 *( <span
>C - bbot )/ width, <span
>1.1 ) + <span
>"%. ", <span
>"" ) );

<span
>WriteIf<font
size=4 face=Arial>( ( trend
> 30 <span
>AND trend < <span
>70 AND
( C > btop <span
>OR C
< bbot ) ) AND <font
color=blue>abs(relwidth) > <font
color=fuchsia>40,

<span
>"This picture
becomes somewhat unclear due to the fact that Bollinger Bands are
currently",

<span
>"Bollinger Bands
are " )+ 

<span
>WriteVal<font
size=4 face=Arial>( <font
color=blue>abs( relwidth ), <font
color=fuchsia>1.1 ) + <font
color=fuchsia>"% " +

<span
>WriteIf<font
size=4 face=Arial>( relwidth
> 0, <font
color=fuchsia>"wider" , <font
color=fuchsia>"narrower" )
+

<span
>" than
normal.";

<span
>WriteIf<font
size=4 face=Arial>( <font
color=blue>abs( relwidth ) < <font
color=fuchsia>40, <font
color=fuchsia>"The current width of the bands
(alone) does not suggest anything conclusive about the future volatility or
movement of prices.",<span
>"")+

<span
>WriteIf<font
size=4 face=Arial>( relwidth
< -40, <font
color=fuchsia>"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 "<span
> + <span
>WriteVal(<span
>BarsSince(<span
>Cross(-<span
>40,relwidth)),<span
>1.0) + <span
>" bars. The probability of a significant price move
increases the longer the bands remain in this narrow range."
,"")+

<span
>WriteIf<font
size=4 face=Arial>( relwidth
> 40, <font
color=fuchsia>"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 "<span
> + <span
>WriteVal(<span
>BarsSince(<span
>Cross(relwidth,<span
>40)),<span
>1.0) + <span
>" bars.The probability of prices consolidating into
a less volatile trading range increases the longer the bands remain in this
wide range." ,"");

<span
>"\nThis
commentary is not a recommendation to buy or sell. Use at your own risk."<font
size=4 face=Arial>; 





<span
> 





<span
>===========================================================================





<font size=2
face="Times New Roman">----- Original Message
----- 







<font
size=2 face=Arial>From: <a
href="" title="johanskatt@xxxxxxxx">johsun 





<span
>To:<font
face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx






<span
>Sent:<font
face=Arial> Tuesday, April 13, 2004 2:32 PM





<span
>Subject:<font
face=Arial> [amibroker] Re: Modify Price Chart





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">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 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 (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 Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US &
Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: <a
href="">amiquote@xxxxxxxxxxxxxxx 
(Web page: 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:
     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:
     http://docs.yahoo.com/info/terms/





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 4/10/2004





<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









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.