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.
|
|
|
|
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
|
|
|
|
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.
|
|
|
|
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?
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
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.
|
|
|
|
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.