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

Re: [amibroker] VB script i give up what is wrong with this code



PureBytes Links

Trading Reference Links


Hi,
 
There is no need to write bollinger bandsusing 
scripting
- they are BUILT-IN into AFL.



BBANDBOT 





SYNTAX 
bbandbot( ARRAY, periods = 15, width = 2 
)

RETURNS
ARRAY

FUNCTION 
Calculates the bottom Bollinger Band of ARRAY shifteddown 
width standard deviations (using periods averaging range 
).

EXAMPLE
bbandbot( close, 10, 2 )

SEE ALSO
 


BBANDTOP 





SYNTAX 
bbandtop( ARRAY, periods = 15, width = 2 
)

RETURNS
ARRAY

FUNCTION 
Calculates the bottom Bollinger Band of ARRAY shifted 
upwidth standard deviations (using periods averaging 
range ).

EXAMPLE
bbandtop( close, 10, 2 )

SEE ALSO
 <FONT face=Tahoma 
size=2>
Best regards,Tomasz Janeczko===============AmiBroker - the 
comprehensive share manager.<A 
href="">http://www.amibroker.com
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
<A title=nickhere@xxxx 
href="">nickhere@xxxx 
To: <A title=amibroker@xxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Friday, June 15, 2001 9:09 
PM
Subject: [amibroker] VB script i give 
up what is wrong with this code
This code return 
nothingEnableScript("vbscript");<%price = AFL ( "high" 
)bb=bbband(price,9,2)Function bbband(price, length, 
StandardDev)bbband = Average(price, length) + (StandardDev * Stddev(price, 
length))End FunctionFunction Average(price, length)Sum = 
0Counter = 0    For Counter = 0 To length - 
1    Sum = Sum + price(Counter)    
NextIf length > 0 ThenAverage = Sum / lengthElseAverage = 
0End IfEnd FunctionFunction Stddev(price, length)SumSqr = 
0Avg = 0Counter = 0If length <> 0 Then   Avg = 
Average(price, length)   SumSqr = 0   For Counter 
= 0 To length - 1     SumSqr = SumSqr + 
(price(Counter) - Avg) * (price(Counter) - Avg)     
Next   Stddev = Sqr(SumSqr / length)Else   
Stddev = 0   End IfEnd FunctionAFL.Var("graph1") = 
bb%>WriteVal( graph1 );Your 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.