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

Notification

Icon
Error

Options
Go to last post Go to first unread
ckmcbaraya  
#1 Posted : Wednesday, February 22, 2017 5:13:17 PM(UTC)
ckmcbaraya

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 2/22/2017(UTC)
Posts: 4

Hi all, 
I'm new to this and I could use some help :)
I wrote in this formula for two EMAs cross over method:

Cross(Mov(C,opt1,E),Mov(C,opt2,E))

I need to add a part for a confirmation signal from the MACD but I don't know how to include it in the formula. 

All and any help is appreciated.

mstt  
#2 Posted : Wednesday, February 22, 2017 11:14:54 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Cross(Mov(C,opt1,E),Mov(C,opt2,E)) AND { whatever you have in mind for the MACD function }. If you can't code the MACD element yourself then you will need to clearly specify any rules so that forum members can accurately create the missing pieces. Just mentioning the MACD function doesn't tell us what you have in mind. Roy
ckmcbaraya  
#3 Posted : Thursday, February 23, 2017 8:28:45 AM(UTC)
ckmcbaraya

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 2/22/2017(UTC)
Posts: 4

Thank you for your reply. And no I can't code it in :) The idea is when the MACD line crosses over the signal line below the zero line, and the 6 EMA crosses over the 21 EMA, it would generate a buy signal and vice versa.
mstt  
#4 Posted : Thursday, February 23, 2017 8:55:22 AM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Do you expect the two crossover events to occur on the same bar or is there some flexibility about when the two crossovers occur relative to each other?
ckmcbaraya  
#5 Posted : Thursday, February 23, 2017 9:15:49 AM(UTC)
ckmcbaraya

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 2/22/2017(UTC)
Posts: 4

No no, the MACD always crosses first which gives me a possibility to enter and then I wait for a confirmation by the EMAs crossing over.
mstt  
#6 Posted : Thursday, February 23, 2017 11:06:59 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
The code below is set up as an indicator. The OPT functions can be enabled for use in the EST but in my opinion any system code should first be tested as an indicator. Code problems can be sorted out much more easily when a result (good or bad) can be plotted on a chart. {New Indicator} M9:= Mov(MACD(),9,E); X:=Cross(Mov(C,6 {opt1},E),Mov(C,20 {opt2},E)); X AND Alert( M9<0 AND Cross(MACD(),M9),5); { Alert() Holds signal TRUE for 5 bars or whatever number you choose} Roy
ckmcbaraya  
#7 Posted : Sunday, February 26, 2017 2:20:04 PM(UTC)
ckmcbaraya

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 2/22/2017(UTC)
Posts: 4

Yeah I guess testing it as an indicator is better. Thank you for your help. One more question, is there a place where I can find or read on how to write these formulas? thanks again.
mstt  
#8 Posted : Monday, February 27, 2017 1:21:19 AM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Learning the ins and outs of the MetaStock Formula Language takes time and practice. The MetaStock User Manual has many of the answers that you need to know, but unless you spend time to solve each problem (however simple) that you come across you're unlikely to reach a reasonable level of proficiency any time soon. In general MetaStock formulas are purely sequential, except possibly for the PREV function. There are no LOOP, JUMP or other functions to redirect the flow of any given formula. My "Formula Language Tutorial" describes each variable in my "Trade Equity GV LE" indicator. This formula requires external inputs to function fully, but by studying just 1 variable at a time there's a lot to be learned if you can find time to follow through. Understand that very few people become "instant" experts with the MetaStock Formula Language. For most of us it takes months, or even years, to master the formula language. Persistence is the most useful talent you will need. The link below has my Formula Language Tutorial and a second Word document providing tools that work as or with my Trade Equity tools. www.metastocktips.co.nz/...a_language_tutorial.zip. If you have any questions you can email me at rlarsen@quik.co.nz Roy
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.