Rank: Newbie
Groups: Registered, Registered Users Joined: 2/20/2009(UTC) Posts: 1
|
Hi all, this is my first post; hope my questions are not too naive.
1. What is the exact formula to implement EMA(4) used in MS?
- I'm trying to build an automatic trading system; I just want to be absolutely sure about the signals. I cross reference with MS computed EMA(4) and excel computation, they're slightly different.
2. Is there a way to export a MS-indicator value as some form of text file? so that I can take those value and implement my trading system.
Thank you kindly.
Ronald
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Hi Ronald,
You can recreate the MS EMA using this code:
---------------------------------------- prd:=21; data:=CLOSE; x:=2/(1+prd); ma:=If(Cum(1)=1,data,(data*x)+(PREV*(1-x))); {plot} ma; ----------------------------------------
However, MS doesn't return a value for the MS until 'prd' is true so the actual output is more like:
---------------------------------------- prd:=21; data:=CLOSE; x:=2/(1+prd); ma:=If(Cum(1)=1,data,(data*x)+(PREV*(1-x))); {plot} (BarsSince(Cum(1)=prd)>=0)*ma; ----------------------------------------
You may experience differences between Excel and MS, mainly because of rounding errors.
Hope this helps.
wabbit [:D]
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.