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

[amibroker] Re: Plot of MA Loop



PureBytes Links

Trading Reference Links

Thanks Steve for your response. I am reasonably familiar with the 
normal Plot() and AddColumn features. Evidently, what I want to 
achieve is not possible unless a loop is used. I have no experience 
with loops and find the available Amibroker (and elsewhere) 
explanations very confusing. I have asked Support but I don't think 
I have been able to explain my problems properly as their response 
has only confused me more. 

My difficulty is with Loops and plotting information from within the 
loop,in this case,e.g. the "Cma". I have tried numerous variations 
without success, such as;
Plot(Cma,"Cma",colorYellow);
I think the problem is the actual wording of the Plot() statement 
and the AB Help files,that I have studied, don't show how to access 
the information.Could you please put me on the right track?
Peter 
  
--- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@xxx> wrote:
>
> 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@xxx>
> 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 --------------------~--> 
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/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/