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

Re: [amibroker] Re: Pivots, Pivots, Pivots........ (explore code)



PureBytes Links

Trading Reference Links

EndDate = LastValue(BarIndex());
i < EndDate + 1 which is saying LastValue(BarIndex()) +1 

You are specifying the last bar past the end of the charts 
The last bar is LastValue(BarIndex())
So use i < EndDate but depending on your formula if it looks into the future
you may need to move the enddate further back with any future look forwards.

You can also replace i=i+1 with just i++
And you may need to have the Phigh as Phigh[i]



Cheers,
Graham
http://www.golala.com/forums/?mforum=asxsharetrading
http://groups.msn.com/fmsaustralia 

-----Original Message-----
From: billbarack [mailto:wbarack@xxxxxxxxxxx] 
Sent: Wednesday, 28 January 2004 4:24 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] For loop help


Can anyone find out why I'm getting a "Error 7 Subscript out of 
Range" error statement on the following code?

Range = 20;
EndDate = LastValue(BarIndex());
StartDate = EndDate - Range + 1;
for(i = StartDate; i < EndDate + 1; i = i + 1)
{
		PHigh = High[i];
}

I've tried everything I could think of to understand this (even 
reading and re-reading the help files :>)  ). These senior moments 
are starting to happen far to often for me !

Thanks,

Bill


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy
Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer
at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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/ 


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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/