markziemann / cryptoblog

collection of code related to analysis of crypto market data
https://mdz-analytics.com/
MIT License
1 stars 2 forks source link

vfi #44

Closed markziemann closed 2 years ago

markziemann commented 2 years ago

current not working code adapted from https://web.archive.org/web/20180212050732/https://mkatsanos.com/VFI.html and

len=130 # periods to use coef=0.2 vcoef=2.5 #max vol cutoff sig=5 #signal line smoothVFI=FALSE

inter <- log(price$high) - log(price$low) vinter <- runner(x=inter,f=sd) cutoff <- coef vinter price$close vave <- SMA( price$volume, length ) vmax <- vave * vcoef price$vmax <- vmax price <- price[which(!is.na(price$vmax)),]

vc = iff(volume < vmax, volume, vmax) //min( volume, vmax )

price$vc <- apply(X=price[,2:6],MARGIN=1,FUN=function(x) { if (x["volume"] <= x["vmax"]) { x["volume"]
} else { x["vmax"]
} } )

markziemann commented 2 years ago

I settled with the MFI for now