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

Re: [amibroker] Another PREV example



PureBytes Links

Trading Reference Links

there is no equivalent to PREV function in AMI but I'm sure TJ will have a
workaround

Have a look at the following code u maybe able to find what u need by
modifying it

/* all-time highest

Use the following formula to find the all-time highest and display its value
and date:***/

alltimehigh = LastValue( Highest( high ) );
alltimehighbar = ValueWhen( high == alltimehigh, Cum(1) );

alltimeyear = ValueWhen( high == alltimehigh, Year() );
alltimemonth = ValueWhen( high == alltimehigh, Month() );
alltimeday = ValueWhen( high == alltimehigh, Day() );

"All time highest was " + WriteVal( alltimehigh );
"on the " + WriteVal( alltimeyear, 1 ) + "." + WriteVal( alltimemonth, 1 ) +
"." + WriteVal( alltimeday, 1 );

/* Draw also a buy arrow on highest day */
buy = high == alltimehigh and Volume > 1000 AND strlen( name() ) == 3;;
sell = 0;


----- Original Message -----
From: "Daniel Ervi" <trader@xxxx>
To: "Amibroker Yahoo Group" <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, September 07, 2001 12:32 PM
Subject: [amibroker] Another PREV example


> Hi All,
>
> I've been struggling to figure out how to code an MS indicator in AFL
> without using VBScript or JScript. The function is pretty straight
forward,
> but the solution still eludes me. Here is the function:
>
> If(Month()<>Ref(Month(),-1),1,PREV+1)
>
> It is recursive, which makes it very simple to understand. It is an
> indicator that plots the current trade day number of the month.
>
> Can anybody offer any ideas on how to get this going?
>
> Thanks in advance!
>
> Daniel
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>