PureBytes Links
Trading Reference Links
|
Hello,
First version (with LastValue) returns NUMBER (scalar)
Second version (without LastValue) returns ARRAY.
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "enzo" <herrfrechdax@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, October 17, 2004 2:02 PM
Subject: [amibroker] Re: Syntax-Error ---> TJ
>
>
> Hello TJ,
>
> the code you suggested me, returns the number of bars where the High
> occurred before last-visible bar. This is perfect. But... the same
> line of code without LastValue() returns the same number!
>
> Why would you use it?
>
> HiBar = LastValue( ValueWhen( Status("firstvisiblebarindex")
> ==BarIndex(), HHVBars( H, per ) ) ); // Result 10 in my test-case
>
> HiBar = ValueWhen( Status("firstvisiblebarindex")==BarIndex(),
> HHVBars( H, per ) ); //Result also 10
>
>
> Thank you and best regards,
> enzo
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
> wrote:
> .
> .
> .
>> b) without loop (shorter)
>>
>> per=20;
>> HiBar = LastValue( ValueWhen( Status("firstvisiblebarindex")
> ==BarIndex(), HHVBars( H, per ) ) );
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>>
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>> ----- Original Message -----
>> From: "enzo" <herrfrechdax@xxxx>
>> To: <amibroker@xxxxxxxxxxxxxxx>
>> Sent: Saturday, October 16, 2004 12:49 AM
>> Subject: [amibroker] Syntax-Error
>>
>>
>> >
>> >
>> > Sorry, but I am almost getting mad. For at least one hour I am
>> > trying this and that and all the time I have a syntax error with
> the
>> > following code:
>> > (want to determine the number of the bar where the last high
>> > occurred before the first visible)
>> >
>> > per=20;
>> > StartBar=Status("firstvisiblebar");
>> > EndBar=StartBar-per;
>> > HiBar=0;
>> > for ( i = startbar; i >= endbar; i-- )
>> > (
>> > if (H[i-1]> H[i] AND H[i-1]>HiBar )
>> > HiBar=i;
>> >
>> > )
>> >
>> >
>> > Thanx for the help.
>> > enzo
>> >
>> >
>> >
>> >
>> >
>> >
>> > Check AmiBroker web page at:
>> > http://www.amibroker.com/
>> >
>> > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/
|