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

[amibroker] Re: Newbie question on coding.



PureBytes Links

Trading Reference Links


take a look at the "LLV" and "ValueWhen" functions; they should 
help...

Walt

--- In amibroker@xxxxxxxxxxxxxxx, "Ray" <georgeraymondcullin@xxxx> 
wrote:
> 
> 
> Thanks in advance for any assistance.
> 
> I'm trying to write what I assume is very simple code, but all I 
get 
> is error messages.  Here's what I'm attempting to do in plain
> English:
> 
> Find the recent trough of low.
> Find the bars to the recent trough of low.
> If the current low is lower than the prior trough of low, then make 
> LL equal to 1 (LL is the variable I use to ID a new low).
> 
> If LL is equal to 1, then test StochD(14).
> 
> If StochD(14) n periods ago (where n is equal to the number of bars 
> to the trough of low) is lower than the current StochD(14), then 
make 
> BullSto equal to one.
> 
> Here is the way I wrote it;
> 
> Change=1;
> BullSto=0;
> LL=0;
> 
> FPT=Trough(L,Change,1);              // Far Price Trough
> BtoFPT=TroughBars(L,Change,1);       // Bars to Far Price Trough
> LL=IIf(L<FPT,1,0);                   // Identifies a Lower Low
> 
> 
> if (LL[0])
> {
>     BullSto=IIf(Ref(StochD(14),-(BtoFPT))<StochD(14),1,0);
> }
> 
> Filter=V1;
> AddColumn(LL,"LL",1.0);
> AddColumn(FPT,"FPT",1.2);
> AddColumn(L,"Low",1.2);
> AddColumn(BtoFPT,"Bars",1.0);
> AddColumn(Ref(StochD(14),-BtoFPT),"%D",1.2);
> AddColumn(BullSto,"Bull Sto",1.0);
> 
> Any help would be appreciated.
> 
> Ray





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/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/