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

Re: [amibroker] Example of a VB User defined function...



PureBytes Links

Trading Reference Links

Hello All: I know that my first message with only code  was very cryptic but I wanted to share it since it was somewhat of a learning breakthrough for me.  I know I could have coded this without the function call but the function call is what I was experimenting with. What this functionality allows for is the recursion function to be used now inside a particular set of VB code.  Since a function can be called then if should follow that it can call itself.  Well VBScript allows this construct anyway.  Now the Metastock "PREV" function can be coded using this feature. I hope this is clear.  Steve W At 06:49 PM 5/30/01 +0000, you wrote: EnableScript("vbscript"); <% close = AFL( "close" ) factor = 0.09 var1=close SetValue Close Function SetValue(Close)    for i = 1 to UBound( close )       var1( i )= factor * close( i ) + (1 - factor) * var1( i -1 )    next end function AFL.Var("graph0") = close AFL.Var("graph1") = var1 %> WriteVal( graph1 );