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

Notification

Icon
Error

Options
Go to last post Go to first unread
Brett  
#1 Posted : Monday, March 8, 2010 5:38:38 PM(UTC)
Brett

Rank: Member

Groups: Registered, Registered Users
Joined: 2/28/2010(UTC)
Posts: 10

I'm trying to run explorer to search for stocks when the "Elder - MACD Combo" histogram turns green. Green means that the histogram has moved up from previous period. Parameters are 12,26,9.

Brett
v.trader  
#2 Posted : Monday, March 8, 2010 9:16:49 PM(UTC)
v.trader

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2009(UTC)
Posts: 76
Location: Toronto, Canada

Would you mind posting the code of the MACD combo or at least explaining what it is because I can't really help you without knowing the idea. Thanks. VT
Brett  
#3 Posted : Tuesday, March 9, 2010 4:34:00 AM(UTC)
Brett

Rank: Member

Groups: Registered, Registered Users
Joined: 2/28/2010(UTC)
Posts: 10

{ Copyright (c) 2004, John Bruns and Financial Trading Inc. }
macShort:=Input("Short MA",1,100,12);
macLong:=Input("Long MA",1,100,26);
macSmooth:=Input("Smoothing Period",1,100,9);
macTime:=Input("Time Ratio",1,22,1);
macFactor:=2; { Histogram Scaling Factor }
macShort:=macShort*macTime;
macLong:=macLong*macTime;
macSmooth:=macSmooth*macTime;
mac:=Mov(C,macShort,E)-Mov(C,macLong,E);
MacSig:=Mov(mac,macSmooth,E);
macplot:=MacFactor*(mac-MacSig);
{note the absolute value of the plot is multiplied by a factor so that it is readable in a window with the standard MACD line plot overlaid on the same axis.}
If(macplot >= Ref(macplot,-macTime), macplot,0);
If(macplot >= Ref(macplot,-macTime), 0, macplot);
mac;
macSig;

><br></div>
            
</div> 
        </div>
    </td>
</tr>
<tr class=
Back to top
v.trader  
#4 Posted : Tuesday, March 9, 2010 6:42:47 AM(UTC)
v.trader

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2009(UTC)
Posts: 76
Location: Toronto, Canada

Hey, when you refer to the histogram, which variable exactly do you mean? Is it mac? or macSig? or If(macplot >= Ref(macplot,-macTime), macplot,0); or If(macplot >= Ref(macplot,-macTime), 0, macplot); Thanks.
Brett  
#5 Posted : Tuesday, March 9, 2010 2:32:17 PM(UTC)
Brett

Rank: Member

Groups: Registered, Registered Users
Joined: 2/28/2010(UTC)
Posts: 10

I'm not certain. My understanding of this formula is to plot the fast moving line, the slow moving line and a histogram. What I'm trying to run in the explorer is when the MACD rises from the following period which corresponds to the histogram in the indicator.
v.trader  
#6 Posted : Tuesday, March 9, 2010 4:22:59 PM(UTC)
v.trader

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/26/2009(UTC)
Posts: 76
Location: Toronto, Canada

Alright, So basically, I think that the histogram that you are referring to is basically the difference between the MACD and the Signal Line. So, first create a new indicator with the following code: {NAME MACD Histogram} FmlVar("MACD Combo","MAC") - FmlVar("MACD Combo","MACSIG"); {NOTE: The MACD Combo phrase refers to the name of the indicator so if the name you have is different change it in the formula} Now this formula is you basic histogram. In order to achieve the conditions you are looking for write this code in the FILTER tab of the explorer: Ref(FML("MACD Histogram"),-2)> Ref(FML("MACD Histogram",-1) AND FML("MACD Histogram")> Ref(FML("MACD Histogram"),-1); { This is for the Macd rising after it has fallen} {if you want to see if only it has risen again, write this:} FML("MACD Histogram")> Ref(FML("MACD Histogram"),-1) VT
Brett  
#7 Posted : Wednesday, March 10, 2010 5:05:57 AM(UTC)
Brett

Rank: Member

Groups: Registered, Registered Users
Joined: 2/28/2010(UTC)
Posts: 10

V.Trader...Thanks for your help...after reviewing your formula and then doing some calculating I realized that your formula is correct...It didn't make sense with what I was seeing on my chart, but then I figured out that they were multiplying the difference by 2 before displaying the histogram just to make it more visible.
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.