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

[amibroker] Re: Arrows



PureBytes Links

Trading Reference Links

The codes are listed below:

The code for graph 1 is:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g,
Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC(
C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("MA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

The code for graph 2 is:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g,
Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O,
H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() ); 
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
 ToolTip=StrFormat("Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g
(%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC(
C, 1 )));
}
_SECTION_END();

_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("Mid MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 45, 2, 200, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("Long MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 100, 2, 200, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("BBands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Style = ParamStyle("Style");
Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color,
Style ); 
Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color,
Style ); 
_SECTION_END();

_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorLavender ),
styleNoTitle | ParamStyle( "Style", styleHistogram | styleOwnScale |
styleThick | styleNoLabel, maskHistogram  ), 2 );
_SECTION_END();

_SECTION_BEGIN("Price Interpretation");
movshort = ParamField("Short Time MA", 8 );
movmed = ParamField("Mid Time MA", 9 );
movlong = ParamField("Long Time MA", 10 );
btop = ParamField("BBTop", 11 );
bbot = ParamField("BBBottom", 12 );
if( Status("action") == actionCommentary )
{
width = btop - bbot;
lslop = LinRegSlope( C, 30 ) + 100;
lslo = LLV( lslop, 90 );
lshi = HHV( lslop, 90 );
lswidth = lshi - lslo;
trend = 100*( lslop - lslo )/lswidth;

mawidth = MA( width, 100 );
relwidth = 100*(width - mawidth)/mawidth;

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

printf("Price and moving averages:\n");
printf( tname + " has closed " + WriteIf( C > movshort, "above" ,
"below" ) + " its Short time moving average. ");

printf("\nShort time moving average is currently " + WriteIf( movshort
> movmed, "above", "below") + " mid-time, AND " + WriteIf( movshort >
movlong, "above", "below" ) + " long time moving averages.");

printf("\nThe relationship between price and moving averages is: "+
WriteIf( C > movshort AND movshort > movmed, "bullish",
WriteIf( C < movshort AND movshort < movmed, "bearish", "neutral" ) )
+ " in short-term, and "+
WriteIf( movshort > movmed AND movmed > movlong , "bullish",
WriteIf( movshort < movmed AND movmed < movlong, "bearish", "neutral"
) ) + " in mid-long term. ");

printf("\n\nBollinger Bands:\n");
printf(tname+ " has closed " + 
WriteIf( C < bbot, "below the lower band by " +
WriteVal( 100 *( bbot-C )/ width, 1.1 ) + "%%. " +
WriteIf( trend < 30, " 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.",
WriteIf( trend > 30 AND trend < 70, "Although prices have broken the
lower band and a downside breakout is possible, the most likely
scenario for "+tname+" is to continue within current trading range.",
"" ) ), "" ) +

WriteIf( C > btop, "above the upper band by " +
WriteVal( 100 *( C- btop )/ width, 1.1 ) + "%%. " +
WriteIf( trend > 70, " 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.",
WriteIf( trend > 30 AND trend < 70, "Although prices have broken the
upper band and a upside breakout is possible, the most likely scenario
for "+tname+" is to continue within current trading range.", "" ) ),
"" ) +

WriteIf( C < btop AND ( ( btop - C ) / width ) < 0.5, 
"below upper band by " +
WriteVal( 100 *( btop - C )/ width, 1.1 ) + "%%. ", 
WriteIf( C < btop AND C > bbot , "above bottom band by " +
WriteVal( 100 *( C - bbot )/ width, 1.1 ) + "%%. ", "" ) ));

printf("\n"+
WriteIf( ( trend > 30 AND trend < 70 AND ( C > btop OR C < bbot ) )
AND abs(relwidth) > 40,
		 "This picture becomes somewhat unclear due to the fact that
Bollinger Bands are  currently",
		 "Bollinger Bands are " )+	  
WriteVal( abs( relwidth ), 1.1 ) + "%% " +
WriteIf( relwidth > 0, "wider" , "narrower" ) +
" than normal.");

printf("\n");

printf(
WriteIf( abs( relwidth ) < 40, "The current width of the bands (alone)
does not suggest anything conclusive about the future volatility or
movement of prices.","")+
WriteIf( relwidth < -40, "The narrow width of the bands suggests low
volatility as compared to " + tname + "'s normal range.  Therefore,
the probability of volatility increasing with a sharp price move has
increased for the near-term. "+
"The bands have been in this narrow range for " +
WriteVal(BarsSince(Cross(-40,relwidth)),1.0) + " bars. The probability
of a significant price move increases the longer the bands remain in
this narrow range." ,"")+
WriteIf( relwidth > 40, "The large width of the bands suggest high
volatility as compared to " + tname + "'s normal range.  Therefore,
the probability of volatility decreasing and prices entering (or
remaining in) a trading range has increased for the near-term. "+
"The bands have been in this wide range for  " +
WriteVal(BarsSince(Cross(relwidth,40)),1.0) + " bars.The probability
of prices consolidating into a less volatile trading range increases
the longer the bands remain in this wide range." ,""));

printf("\n\nThis commentary is not a recommendation to buy or sell.
Use at your own risk.");
}
_SECTION_END();

And the code for graph 3 is:
_SECTION_BEGIN("Accelleration Bands");
MaxGraph=6;
x=(H-L)/(H+L)/2;
ub=EMA(H*(1+2*((2*X)*100)*.01),20);
Lb= EMA(L*(1-2*((2*X)*100)*.01),20);
mb=MA(C,20);
Graph5=EMA(C,150);
Graph5Style=5+4;
Graph5Color=7;
Graph0=ub;
Graph0Color=27;
Graph0Style=1+4;
Graph1Style=1+4;
Graph1=mb;
Graph2=Lb;
Graph2Style=1+4;
Graph2Color=4;

upbar = H > Ref( H, -1 ) AND L >= Ref( L, -1 );
downbar = L < Ref( L, -1 ) AND H <= Ref( H, -1 );

Plot(C,"",1,64);

Title = Name () + " - " + FullName()+ Date() +" - Accelleration BANDS
   Yellow = 150 EMA" ;
_SECTION_END();
--- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@xxxx> wrote:
> Hi,
> 
> Hard to say without seeing any of the code. Are you using
Plotshapes? By 
> default, Plotshapes puts arrows at the first indicator plotted but
you can 
> change this ( see help for Plotshapes ). It looks to me like they are 
> plotted around the low in the first 2 pictures, and around the green
MA in 
> the last one.
> 
> Steve
> 
> ----- Original Message ----- 
> From: <ct1942@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Sunday, August 21, 2005 3:07 PM
> Subject: [amibroker] Arrows
> 
> 
> > Can someone examine the three enclosed graphs and tell me why I get
> > three different types of arrow formations?
> >
> > 1.On graph 1,the arrows are below the bars.
> > 2.On graph 2,there are 2 arrows below the bars.
> > 3.On graph 3, some arrows are below the bars and some are above the
> > bars. Their position seems to be deter

> > the bars.
> >
> > Any help would be appreciated.
> >
> > Thanks,
> >
> > Cordell
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hkfmqtg/M=362131.6882500.7825259.1493532/D=groups/S=1705632198:TM/Y=YAHOO/EXP=1124688393/A=2889190/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Put more honey in your pocket. (money matters made easy) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/