PureBytes Links
Trading Reference Links
|
To be able to plot a chart, you need to use the Plot() function at the end
of your code. See the help file for details on Plot(). When that is done,
plot a built-in price chart by finding it under the charts tab on the left
and double-clicking on it. Then find your code for MA under the charts tab,
drag it and drop it on the price chart.
To show a column in the exploration results, you need to use either
AddColumn or AddTextColumn functions in your code. Again, see the help file
for details. Also, read the tutorials in the help file.
Steve
----- Original Message -----
From: "peterjldyke" <peterjldyke@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, May 11, 2006 12:27 AM
Subject: [amibroker] Plot of MA Loop
> The following was supplied to another user in answer to a previous
> post. I have limited knowledge of loops etc so need help. The aim is
> to have the afl calculate a Moving Average that "sits" just below 12
> months (say 252 days) price action without the Close crossing below
> the computer calculated MA period. Only interested in strong
> uptrending stocks.
> I can't work out how to Plot the result or use the Explore feature
> to print out the result.
>
> function CheckMACross( period, Lookback )
> {
> result = False;
>
> Cma = MA( C, period );
>
> bar = BarCount - 1 - Lookback; //Max bars less Lookback.
>
> if( Close[ bar ] < Cma[ bar ] )
> {
> while( bar < BarCount )
> {
> if( Close[ bar ] > Cma[ bar ] )
> {
> result = True;
> }
>
> bar++;
> }
> }
>
> return result;
>
>
> }
>
> function WCBelowMALine()
> {
> found = False;
>
> for ( period = 1; period <= 252 AND NOT found; period++)
> {
> found = CheckMACross( period, 252 );
> }
> return period;
>
>
> What AA column headings do I use to get an "Exploration" of the
> Close and the calculated MA?
> How can I amend the above to get a Candlestick plot of the Close as
> well as a plot of the calculated MA?
>
> Any help would be appreciated.
> Peter
>
>
>
>
>
>
>
>
> 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 --------------------~-->
Home is just a click away. Make Yahoo! your home page now.
http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
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/
|