logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
DayTrader  
#1 Posted : Friday, September 30, 2005 11:00:41 AM(UTC)
DayTrader

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 19
Location: Zagreb, Croatia

I am creating custom MA indicator. With input function I can chose period for that MA (prior plotting on the chart). That works fine, but... Now I would like to be able in custom MA indicator to chose also method from drop down list. Is it possible? Which function I should use?
Jose  
#2 Posted : Friday, September 30, 2005 11:25:49 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Try this MS code: [code:1:52942defb2]pds:=Input("Mov Avg periods",1,2600,21); type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]Wght",1,7,2); { Choose MovAvg type: 1 - Exponential MA 2 - Simple MA 3 - Time Series MA 4 - Triangular MA 5 - Variable MA 6 - Volume adjusted MA 7 - Weighted MA } ma:= If(type=1,Mov(C,pds,E), If(type=2,Mov(C,pds,S), If(type=3,Mov(C,pds,T), If(type=4,Mov(C,pds,TRI), If(type=5,Mov(C,pds,VAR), If(type=6,Mov(C,pds,VOL), Mov(C,pds,W))))))); { Plot on price chart } ma [/code:1:52942defb2] jose '-) http://www.metastocktools.com
DayTrader  
#3 Posted : Friday, September 30, 2005 12:22:59 PM(UTC)
DayTrader

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 19
Location: Zagreb, Croatia

Thanks Jose. Your code solves problem, but the result is not exactly what I was expecting. With "input" function I can simply edit the number, but I was thinking that I will be able to create ComboBox (drop down list) with all options (simple, exponential, etc...). Something similar to original MA indicator. See the picture. Can I do it in MetaStock?
Jose  
#4 Posted : Friday, September 30, 2005 11:51:13 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
DayTrader wrote:
...but I was thinking that I will be able to create ComboBox (drop down list) with all options (simple, exponential, etc...). Something similar to original MA indicator. Can I do it in MetaStock?
Unfortunately, the simple answer is no. jose '-)
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.