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

[amibroker] Re: Adapt TEMA period to volatility - help



PureBytes Links

Trading Reference Links


Hans,
It is not a matter of 28, the level may vary.
The problem is in the
V1=int(n-Volatility1);
It may become negative and, after some bars, TEMA will become empty.
Dimitris
--- In amibroker@xxxxxxxxxxxxxxx, "Hans" <hansib@xxxx> wrote:
> 
> hello all,
> 
> I'm trying to code "inverse" relation to of any Average to 
Volatility.
> I have some problems with this code, because it works "only" for 
> V1>28 (not precisely this level, this is a calculated value).
> I really do not understand why it does not work for smaller values 
> since if I write them manually the code is working properly.
> 
> I hope anyone can suggest better code and possibly some general 
> parametrized method to calculate inverse relation from volatility 
to 
> averages periods.
> 
> Indicator code:
> 
> n=46; Period1=10;
> n = Param("Periods",n,2,80,1);
> Period1=Param("period 1",Period1,1,100,1);
> 
> Volatility1 = StDev(log(C/Ref(C,-1)),Period1)*sqrt(365/7)*100;
> V1=int(n-Volatility1);
> Var1= TEMA(Close,v1); 
> 
> 
> Plot(Volatility1,"Volatility1 [ "+WriteVal(period1,1.0)
> +"]",colorRed,styleLine|styleOwnScale);
> Plot(V1,"V1 [ "+WriteVal(V1,1.0)
> +"]",colorGreen,styleLine|styleOwnScale);
> 
> Plot(Var1,"TEMA volatility" + "("+WriteVal( V1, 1.0 )+")",6,4);





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/