PureBytes Links
Trading Reference Links
|
Natasha,
The problem is you need to get a single (numeric) value of TstCy. You can do
this with SelectedBar(TstCy) or LastValue(TstCy). Then your loop would be:
for ( i = 0 ; i < TstCy ; i ++ )
{
xyz[i] = C[i]; //or whatever you need
}
However, it does not seem that the array you want to access is actually
TstCy as this seems to be just the count. Access whatever array is needed
such as the Close (as shown). Also you probably don't want to start at bar i
= 0; but some other bar. Maybe that is barCount - TstCy or:
for ( i = barCount - TstCy ; i < barCount; i ++ )
This does get a little confusing when trying to do a series of peaks and
troughs.and I'm sure I don't need to remind you that both Peak and Trough
use ZigZag which looks into the future.
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Natasha ~~!!!
Sent: Monday, January 22, 2007 09:36
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Array in a loop
hello,
PkCy =PeakBars( probability ,a, 1);
TrCy =TroughBars(probability,a,1 );
TstCy= IIf(PkCy > TrCy,TrCy,PkCy) ;
for
( i =0 ; i < TstCy ; i ++ )
I have a problem with the array TstCy , i would like to use
the array in a loop .
Thanks .
Warm Regards;
`````` Natasha !!!
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.5/645 - Release Date: 1/22/2007 4:10 PM
|