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

Re: Defining an array in VBScript



PureBytes Links

Trading Reference Links

you need to 'force' PR into an array datatype, before entering 
VBSscript. You can do this by

PR=Close;
or
PR =Open;

or any other AB array, as long as you reset the value somehow in your 
VBScript.

do NOT write PR=0 - this will return PR to a 'number' rahter 
than 'array' type

so -



EnableScript("VBScript");
PR=Close;
PR=AFL("PR');

<%
DIM PriceRange(1,25)
For a = 0 to 24(PriceRange)
PR(a)=PR(a)+2
Next

<%
AFL("PR")=PR;


Steve


--- In amibroker@xxxx, "knewhous" <knewhous@xxxx> wrote:
> I am attempting to write an exploration to find all the Highs and 
all 
> the Lows that have occurred within a range of prices at steps of a 
> nominated amount.
> 
> In this instance it is the AUS$ with a price range of .5250 
to .5750 
> with stepped increments of .0020.
> 
> I need to set up a seperate array for the price steps so that I 
have 
> a Major Loop incrementing .0020 each time and a Minor Loop for the 
> AFL array incrementing a period at a time.
> 
> I am having trouble defining the array in VBScript and filling with 
> values.
> I have used -
> 
> EnableScript("VBScript");
> 
> PR=AFL("PR');
> PR=0;
> 
> <%
> DIM PriceRange(1,25)
> For a = 0 to 24(PriceRange)
> PR(a)=PR(a)+2
> Next
> 
> I get the message "type mismatch"
> 
> Can anyone assist, please?
> 
> Regards,
> Keith.