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

Re: [amibroker] Re: The old divergences thread (for DT)



PureBytes Links

Trading Reference Links

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The use of the Cum() function forces ALL bars the be loaded.  (You can do the 
same in a more obvious fashion with SetBarsRequired()).

Of course, that doesn't explain anything w.r.t. the code you have quoted.  
Perhaps in the rest of it?

	Nigel

On Thu, 29 Jan 2004 18:43, Dave Merrill wrote:
> 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
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAGM3yBbmcM2pfckkRAvqpAKDwaEa/zlZ0qkqxyt1aP2dJSwBsFwCeJSMv
0ToCu1IHAnlhZPAXu0rua5M=
=pDxc
-----END PGP SIGNATURE-----


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 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/