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

Re: [amibroker] Chart Title Question



PureBytes Links

Trading Reference Links

Can anyone hazard a guess as to why a piece of code I'm working on generates
a subscript out of range error, unless I add a nearly do-nothing line of
code, which can run *after* everything else?

Here's the section of code I think is causing the error. With the last line
in place as written, it's fine. Comment that out, you get a subscript out of
range error on the next to last line.

------------------

PriceAdjFactor = Param("4-Price Adjust %", 0, -25, 25, .01);

BI = BarIndex();
SelBI = SelectedValue(BI);

PriceReal = C;
PriceAdjusted = PriceReal;

PriceAdjusted[SelBI] = PriceReal[SelBI] * ((PriceAdjFactor / 100) + 1);
Plot(LastValue(Cum(1)), "LastValue(Cum(1))", colorYellow,
styleNoDraw+styleNoRescale);

------------------

That last line doesn't set any variables. It doesn't plot anything. It only
adds to the default chart title. Why should it have any effect at all on
anything, much less code that runs *before* it?

Dave


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/