PureBytes Links
Trading Reference Links
|
On the other side, if your index has counting properties, there is no
problem to use it as a new subscript.
Example
x=Cum(1);
for(i=0;i<BarCount;i++)
{
index[i]=x[i]%1000;
Variable[index[i]]=sqrt(index[i]);
}
Plot(Variable,"v",1,1);
Plot(sqrt(x),"",4,8);
index[i] will be 0 to 999 and the Variable plot will be the first 999
points of sqrt(x).
I hope it is clear.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
wrote:
> index value index[i] can not be placed inside the [] because it may
> be out of range.
> Your variable[i] may be a function of index[i] in the following
sense
>
> array=StochD();
> for(i=0;i<BarCount;i++)
> {
> index[i]=array[i]^2;//index is a function of array
> Variable[i]=sqrt(index[i]);//variable is a function of index
> }
> Plot(Variable,"",1,1);
> Plot(sqrt(StochD()^2),"",4,8);
>
> Dimitris Tsokakis
>
> --- In amibroker@xxxxxxxxxxxxxxx, "gerryjoz" <geraldj@xxxx> wrote:
> > AFL distinguishes between NUMBER and ARRAY for some functions.
> > Although there is a selectedvalue function for picking up the
> current
> > NUMBER value on a chart, i can't see a way to pick the current
> NUMBER
> > value of an array as AB is iterating through on a backtest
(without
> a
> > do loop?).
> > What i want to be able to do is to assign
> > index=currentValueofArray1;//result to be a number not an array
> > variable[index]=currentValueOfArray2;
> > ....And not get an error message that i need to have a NUMBER and
> not
> > an ARRAY.
> > I would appreciate advice on a way of doing this.
> >
> >
> > Regards Gerry
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
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/
|