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

Re: [amibroker] Yuki BuiltinPriceCode



PureBytes Links

Trading Reference Links

Hi Ron,

Thanks, but I'm not going to try it yet.  I'm not touching the D&D
interface again until I understand why every custom indicator at the
top of my custom list is being overwritten every time I touch
something in D&D.

I also may go back to a previous release.  This one has problems, or
things I do not understand.  I looked at the video, twice.

Yuki

Wednesday, September 22, 2004, 11:49:03 AM, you wrote:


m> Yuki, here is the builtin Price code.  It has some custom code
m> in it that is commented out.  It will not work in my desktop when
m> I uncomment this custom code, but the builtin coding works fine
m> when the custom code is commented out. 

m> Interestingly, it works fine either way in my Compaq notebook, commented, or  uncommented.

m> If you decide to try this, I would like to hear if it worked
m> for you in your builtin price chart when it is uncommented.  

m> I just now pasted this code in a custom window, and it won't work there either.  Ron D

m> ==========================================

m> /*Plot(IIf(C>O,C/O,O/C),"PctYel",colorYellow,styleOwnScale);

m> Plot(EMA(IIf(C>O,C/O,O/C),3),"Ema3PctGrn",colorBrightGreen,styleOwnScale);

m> Plot(EMA(IIf(C>O,C/O,O/C),4),"Ema10PctBlu",colorBlue,styleOwnScale);

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

m> BbotDip=bbot>Ref(bbot,-1) AND Ref(bbot,-1)<Ref(bbot,-2);

m> Midbody0=IIf(C>O,(C-O)/2+O,(O-C)/2+C);

m> Midbody=IIf(Midbody0>Ref(Midbody0,-1),Ref(Midbody0,-1),Midbody0);

m> Midbody2=EMA(midbody,2);

m> BbotGrtr=bbot>Ref(bbot,-1);

m> Midbody3=EMA(midbody,3);

m> Midbody4=EMA(midbody,4);

m> Midbody5=EMA(midbody,5);

m> Midbody6=EMA(midbody,6);

m> Midbody7=EMA(midbody,7);

m> Midbody8=EMA(midbody,8);

m> Midbody9=EMA(midbody,9);

m> Midbody10=EMA(midbody,10);

m> Plot(midbody0,"MdbyYel",colorYellow,styleThick);

m> Title="Lines for Month,Week";

m> Plot(IIf(Month()!=Ref(Month(),-1),1,0),"",42,styleHistogram|styleOwnScale|styleNoLabel,0,5);

m> Plot(IIf(DayOfWeek()<Ref(DayOfWeek(),-1),1,0),"",43,styleHistogram|styleOwnScale|styleNoLabel,-0.55,12);

m> Plot(IIf(Month()!=Ref(Month(),-1),1,0),"",42,styleHistogram|styleOwnScale|st

m> yleNoLabel,0,5);

m> Plot(IIf(DayOfWeek()<Ref(DayOfWeek(),-1),1,0),"",43,styleHistogram|styleOwnS

m> cale|styleNoLabel,-0.55,12);*/



m> //--Indicator-End--

m> // Above line instructs the parser that the code

m> // below is only for commentary/interpretation window

m> // This provides significant performance improvement

m> //

m> // (C)2002 amibroker.com





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





m> movshort = MA( C, Prefs(4) );

m> movmed = MA( C, Prefs(6) );

m> movlong = MA( C, Prefs(28) );

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

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

m> width = btop - bbot;

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

m> lslo = LLV( lslop, 90 );

m> lshi = HHV( lslop, 90 );

m> lswidth = lshi - lslo;

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

m> mawidth = MA( width, 100 );

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

m> _N( tname = Name()+"("+FullName()+")" );

m> "Price and moving averages:";

m> tname + " has closed " + WriteIf( C > movshort, "above" ,
m> "below" ) + " its short time moving average. ";

m> "Short time moving average is currently " + WriteIf( movshort
m> > movmed, "above", "below") + " mid-time, and " + WriteIf(
m> movshort > movlong, "above", "below" ) + " long time moving
m> averages.";

m> "The relationship between price and moving averages is: "+

m> WriteIf( C > movshort AND movshort > movmed, "bullish",

m> WriteIf( C < movshort AND movshort < movmed, "bearish",
m> "neutral" ) ) + " in short-term, and "+

m> WriteIf( movshort > movmed AND movmed > movlong , "bullish",

m> WriteIf( movshort < movmed AND movmed < movlong, "bearish",
m> "neutral" ) ) + " in mid-long term. ";


m> "\nBollinger Bands:";

m> tname+ " has closed " + 

m> WriteIf( C < bbot, "below the lower band by " +

m> WriteVal( 100 *( bbot-C )/ width, 1.1 ) + "%. " +

m> WriteIf( trend < 30, " This combined with the steep downtrend
m> can suggest that the downward trend in prices has a good chance of
m> continuing. However, a short-term pull-back inside the bands is
m> likely.",

m> WriteIf( trend > 30 AND trend < 70, "Although prices have
m> broken the lower band and a downside breakout is possible, the
m> most likely scenario for "+tname+" is to continue within current
m> trading range.", "" ) ), "" ) +

m> WriteIf( C > btop, "above the upper band by " +

m> WriteVal( 100 *( C- btop )/ width, 1.1 ) + "%. " +

m> WriteIf( trend > 70, " This combined with the steep uptrend
m> suggests that the upward trend in prices has a good chance of
m> continuing. However, a short-term pull-back inside the bands is
m> likely.",

m> WriteIf( trend > 30 AND trend < 70, "Although prices have
m> broken the upper band and a upside breakout is possible, the most
m> likely scenario for "+tname+" is to continue within current
m> trading range.", "" ) ), "" ) +

m> WriteIf( C < btop AND ( ( btop - C ) / width ) < 0.5, 

m> "below upper band by " +

m> WriteVal( 100 *( btop - C )/ width, 1.1 ) + "%. ", 

m> WriteIf( C < btop AND C > bbot , "above bottom band by " +

m> WriteVal( 100 *( C - bbot )/ width, 1.1 ) + "%. ", "" ) );

m> WriteIf( ( trend > 30 AND trend < 70 AND ( C > btop OR C <
m> bbot ) ) AND abs(relwidth) > 40,

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

m> "Bollinger Bands are " )+ 

m> WriteVal( abs( relwidth ), 1.1 ) + "% " +

m> WriteIf( relwidth > 0, "wider" , "narrower" ) +

m> " than normal.";

m> WriteIf( abs( relwidth ) < 40, "The current width of the bands
m> (alone) does not suggest anything conclusive about the future
m> volatility or movement of prices.","")+

m> WriteIf( relwidth < -40, "The narrow width of the bands
m> suggests low volatility as compared to " + tname + "'s normal
m> range. Therefore, the probability of volatility increasing with a
m> sharp price move has increased for the near-term. "+

m> "The bands have been in this narrow range for " +
m> WriteVal(BarsSince(Cross(-40,relwidth)),1.0) + " bars. The
m> probability of a significant price move increases the longer the
m> bands remain in this narrow range." ,"")+

m> WriteIf( relwidth > 40, "The large width of the bands suggest
m> high volatility as compared to " + tname + "'s normal range.
m> Therefore, the probability of volatility decreasing and prices
m> entering (or remaining in) a trading range has increased for the
m> near-term. "+

m> "The bands have been in this wide range for " +
m> WriteVal(BarsSince(Cross(relwidth,40)),1.0) + " bars.The
m> probability of prices consolidating into a less volatile trading
m> range increases the longer the bands remain in this wide range."
m> ,"");

m> "\nThis commentary is not a recommendation to buy or sell. Use at your own risk.";


m> ---
m> Outgoing mail is certified Virus Free.
m> Checked by AVG anti-virus system (http://www.grisoft.com).
m> Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004


m> [Non-text portions of this message have been removed]




m> Check AmiBroker web page at:
m> http://www.amibroker.com/

m> Check group FAQ at:
m> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
m> Yahoo! Groups Links







------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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:
    http://docs.yahoo.com/info/terms/