Insider 3000 - Forums
Insider 3000 - Forums
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Problemi con "Insider 3000 versione 3"
 Problemi col linguaggio di programmazione
 volatilità storica
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jsamu
Nuovo Utente

28 Posts

Posted - 19 September 2006 :  23:07:43  Show Profile  Reply with Quote
Vorrei calcolare la volatilità storica ma la funzione stdev mi da errore in quanto mi richiede un array...
la formula che uso è la seguente per una vs a 50 periodi:

stdev(log(close / close( - 1)), 50) * 100 * sqr(256)

Non c'è modo di bypassare l'errore?
La volatilità proposta dal programma in cosa si differenzia?

Grazie

SupportoTecnico
Forum Admin

1261 Posts

Posted - 20 September 2006 :  10:01:03  Show Profile  Reply with Quote
Potresti creare una funzione che calcola la deviazione standard e poi usare il tutto come segue:


function main()
return MyStdev(50) * 100 * sqr(256)
endfunction


Function MyStdev(lPeriod as Numeric) As Numeric
Dim dMyMov As Numeric
Dim dVar As Numeric
Dim i As Numeric

dMyMov = 0
for i = 0 to lPeriod - 1
dMyMov = dMyMov + log(close( - i) / close( - i - 1))
Next i
dMyMov = dMyMov / lPeriod

dVar = 0
For i = 1 to lPeriod
dVar = dVar + (dMyMov - log(close(1 - i) / close( - i))) ^ 2
Next i
dVar = dVar / lPeriod

Return Sqr(dVar)

EndFunction

Go to Top of Page

jsamu
Nuovo Utente

28 Posts

Posted - 20 September 2006 :  16:51:02  Show Profile  Reply with Quote
Grazie, disponibile come al solito!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Insider 3000 - Forums © Copyright 2003-2016 Tradersoft s.r.l. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07