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

Notification

Icon
Error

Options
Go to last post Go to first unread
AVENGINE  
#1 Posted : Monday, February 8, 2010 12:05:43 PM(UTC)
AVENGINE

Rank: Member

Groups: Registered, Registered Users
Joined: 6/14/2007(UTC)
Posts: 17

I got the formula from http://www.meta-formula....tml#Elders_AutoEnvelope_ Elder's Impulse system { Dr Elder's Impulse system interpretation v1.1}{ Plot signals on own window below daily chart } { Variables user-input } pdsNoEntry:=Input("No entry x periods from last exit",0,21,5); pdsW:=Input("Weekly EMA periods",1,520,13)*5; pdsD:=Input("Daily EMA periods",1,252,13); pdsShort:=Input("Shorter MACD periods", 1,252,12); pdsLong:=Input("Longer MACD periods",2,2520,26); pdsSignal:=Input("MACD trigger signal periods", 2,252,9); tradeDelay:=0; { Indicators } EmaW:=Mov(C,pdsW,E); EmaD:=Mov(C,pdsD,E); Mac:=Mov(C,pdsShort,E)-Mov(C,pdsLong,E); MacTrig:=Mov(Mac,pdsSignal,E); Hist:=Mac-MacTrig; { System logic } Out:={EmaW<ref(EmaW,-1) AND }EmaD<ref(EmaD,-1) AND Hist<ref(Hist,-1); In1:=EmaW>Ref(EmaW,-1) AND EmaD>Ref(EmaD,-1) AND Hist>Ref(Hist,-1); In:=In1 AND BarsSince(Out)>pdsNoEntry; { System signals } Init:=Cum(In+Out>-1)=1; InInit:=Cum(In)=1; flag:=Ref(BarsSince(Init OR In) <barsSince(Init OR Out)+InInit,-tradeDelay); signals:=(InInit AND Alert(InInit=0,2) OR flag AND Alert(flag=0,2)) -(flag=0 AND Alert(flag,2)); { Plot } 0;signals I would like to know how can i make this into a expert system so that I can get the alert. thanks.
johnl  
#2 Posted : Tuesday, February 9, 2010 6:39:24 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602


There shouldn't be any programming to convert the indicator to an expert. Look at how a similar expert is done that you like and follow that example. Use the user manual as a reference. Creating the indicator is usually the difficult part. If you get stuck, post your results.
henry1224  
#3 Posted : Tuesday, February 9, 2010 7:29:01 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
this section has undefined errors listed in bold
{ System logic }
Out:={EmaW AND }EmaD AND HistIn1:=EmaW>Ref(EmaW,-1)
AND EmaD>Ref(EmaD,-1)
AND Hist>Ref(Hist,-1);
In:=In1 AND BarsSince(Out)>pdsNoEntry;

if you correct those the code will work in metastock

it looks like code from Jose Silva, so look in metastocktools.com
henry1224  
#4 Posted : Tuesday, February 9, 2010 7:37:57 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
here is the code from Jose Silva and Metastocktools.com

======================
Elder's Impulse system
======================
---8<------------------------------------------

{ Dr Elder's Impulse system interpretation v1.1
Plot signals on own window below daily chart.
http://www.elder.com/MetaStock/Impulse.htm

http://www.metastocktools.com }

{ Variables user-input }
pdsNoEntry:=Input("No entry x periods from last exit",0,21,5);
pdsW:=Input("Weekly EMA periods",1,520,13)*5;
pdsD:=Input("Daily EMA periods",1,252,13);
pdsShort:=Input("Shorter MACD periods",
1,252,12);
pdsLong:=Input("Longer MACD periods",2,2520,26);
pdsSignal:=Input("MACD trigger signal periods",
2,252,9);
tradeDelay:=0;

{ Indicators }
EmaW:=Mov(C,pdsW,E);
EmaD:=Mov(C,pdsD,E);
Mac:=Mov(C,pdsShort,E)-Mov(C,pdsLong,E);
MacTrig:=Mov(Mac,pdsSignal,E);
Hist:=Mac-MacTrig;

{ System logic }
Out:={EmaW<Ref(EmaW,-1)
AND }EmaD<Ref(EmaD,-1)
AND Hist<Ref(Hist,-1);
In1:=EmaW>Ref(EmaW,-1)
AND EmaD>Ref(EmaD,-1)
AND Hist>Ref(Hist,-1);
In:=In1 AND BarsSince(Out)>pdsNoEntry;

{ System signals }
Init:=Cum(In+Out>-1)=1;
InInit:=Cum(In)=1;
flag:=Ref(BarsSince(Init OR In)
<BarsSince(Init OR Out)+InInit,-tradeDelay);
signals:=(InInit AND Alert(InInit=0,2)
OR flag AND Alert(flag=0,2))
-(flag=0 AND Alert(flag,2));

{ Plot }
0;signals

---8<------------------------------------------


http://www.metastocktools.com

AVENGINE  
#5 Posted : Wednesday, February 10, 2010 1:26:43 PM(UTC)
AVENGINE

Rank: Member

Groups: Registered, Registered Users
Joined: 6/14/2007(UTC)
Posts: 17

thanks for all the reply, in metastock expert system, most of them I try before do not has the user input, is there some example in ms10 that use this function, so that I can try to follow it and apply the code into my charts. I am using 3 in no entry x periods from last exit. thanks.
johnl  
#6 Posted : Wednesday, February 10, 2010 6:59:30 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

Work backwards from simple to hard. Redefine the user inputs to something like:

pdsNoEntry:=5;
pdsW:=13*5;
pdsD:=13;

etc. to create the expert.








Users browsing this topic
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.