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

Re: [amibroker] Converting Metastock formulae to Amibroker?



PureBytes Links

Trading Reference Links


Hello,
<BLOCKQUOTE 
>
Can anyone tell me what the "prev" function in 
Metastock does, and what the Amibroker equivalent is? <FONT 
face="Comic Sans MS">I want to program the following (Metastock, Ithink) 
formulae:
 
enter long(cci(13)<-100 or prev(cci(13),1)<-100 or 
prev(cci(13),2)<-100 or prev(cci(13),3)<-100) 
AND(mov(c,5,e)-mov(c,35,e)<mov((mov(c,5,e)-mov(c,35,e)),4,e)) AND 
ult(7,14,28)<30
exit long(cci(13)>-100 or prev(cci(13),1)>-100 or 
prev(cci(13),2)>-100 or prev(cci(13),3)>-100) 
AND(mov(c,5,e)-mov(c,35,e)>mov((mov(c,5,e)-mov(c,35,e)),4,e)) AND 
ult(7,14,28)>70
I can guess at what the other functionsare 
doing, eg. mov(c,5,e)=ema(c,5) etc.
 
Above formula can be written in AFL in the following 
way:

buy = (cci(13)<-100 or ref(cci(13),-1)<-100 or 
ref(cci(13),-2)<-100 or ref(cci(13),-3)<-100) 
AND(ema(c,5)-ema(c,35)<ema((ema(c,5)-ema(c,35)),4)) AND 
ultimate(7,14,28)<30
sell=(cci(13)>-100 or ref(cci(13),-1)>-100 or 
ref(cci(13),-2)>-100 or ref(cci(13),-3)>-100) 
AND(ema(c,5)-ema(c,35)>ema((ema(c,5)-ema(c,35)),4)) AND 
ultimate(7,14,28)>70
 
 
<BLOCKQUOTE 
>
 
Q's for Tomasz - (<FONT 
face="Comic Sans MS">For the wish list)
Linear regression functions.<FONT 
face="Comic Sans MS"> 
SLOPE(m) Returns the slope of the line,based 
on regression over last m days.
LR(m,n) Returns the value of the regression 
line over last m days, at the point n days ago.
Thank you for the suggestion. Linear regression is 
planned for the next release (I must update to-do list !!!)
<BLOCKQUOTE 
>
Check for missing data
Add some way of checking for missing data. 

Public holidays will be a problem, but the 
user can check these manually I suppose.
Thanks again.<FONT 
face="Comic Sans MS">
 
 
Best regards,Tomasz Janeczko===============AmiBroker - the 
comprehensive share manager.Web site: <A 
href="">http://www.amibroker.w.plMailinglist: 
<A 
href="">amibroker@xxxx