I always feel it best to start with i=1
You specify inputs of vv and pp for the function, but you
have not sued them within the calculation
I checked against a range of stocks and got the same results
for explore and scan
function ffZig(vv,pp) {
//
initialize fzg array
fzg = 0;
// perform
loop to fill fzg array
for( i = 0; i < BarCount; i= i + 10 ) {
fzg[ i ] = 1;
}
return fzg;
}
SetBarsRequired(10000,10000);
ZZ = ffZig(C,0) ;
Buy = ZZ == 1;
Short = 0;
PlotShapes( shapeUpArrow*Buy, colorGreen);
Plot(C, " ", colorBlue, styleCandle ) ;
Filter = 1;
AddColumn(Buy,"Buy");
-----Original Message-----
From: ed nl
[mailto:ed2000nl@xxxxxxx]
Sent: Monday, December 27, 2004
5:30 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] what am I
doing wrong??
can't figure out what I am doing
wrong. Below a simple example. I create an array using a function. This array I
use to find Buy signals. I put the buy signals in a chart. All seems good. Then
I do an explore and then I see that the explore puts the buy signals at a
different date. There seems nothing strange about the code. What could be
wrong?
function ffZig(vv,pp) {
// initialize fzg array
fzg = 0;
// perform loop to fill fzg array
for( i = 0; i < BarCount; i=
i + 10 ) {
fzg[ i ] = 1;
}
return fzg;
}
SetBarsRequired(10000,10000);
ZZ = ffZig(C,0) ;
Buy = ZZ == 1;
Short = 0;
PlotShapes( shapeUpArrow*Buy, colorGreen);
Plot(C, " ", colorBlue, styleCandle ) ;
Filter = 1;
AddColumn(Buy,"Buy");
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor |
ADVERTISEMENT
| |
|
Yahoo! Groups Links