Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/13/2005(UTC) Posts: 715 Location: Midwest, USA
Was thanked: 1 time(s) in 1 post(s)
|
Well, here's a couple of things to play with...
I assume you can create a custom indicator, and adjust the color, style, etc. Also, note that when you drag any indicator into a chart, if you drag it down to the X-AXIS, the mouse cursor changes to a little rectangle, and will create a new window -- if the indicator stays as a little squiggly line, the indicator you are dragging will be added to whichever window it's in when you release the mouse button.
1. These two will plot a count of crossovers. ---------------------------------------------
{* Thumbs Up *} Lookback:=Input("Lookback",1,10000,1260);
Sum(Cross(C,Mov(C,90,E)),Lookback) +Sum(Cross(C,Mov(C,120,E)),Lookback) +Sum(Cross(C,Mov(C,150,E)),Lookback) +Sum(Cross(C,Mov(C,180,E)),Lookback);
{* Thumbs Down *} Lookback:=Input("Lookback",1,10000,1260);
Sum(Cross(Mov(C,90,E),C),Lookback) +Sum(Cross(Mov(C,120,E),C),Lookback) +Sum(Cross(Mov(C,150,E),C),Lookback) +Sum(Cross(Mov(C,180,E),C),Lookback);
2. This will plot a binary indicator, showing which count is higher. ----------------------------------------------------------------- {* Combo *} Lookback:=Input("Lookback",1,10000,1260);
ThumbsUp:= Sum(Cross(C,Mov(C,90,E)),Lookback) +Sum(Cross(C,Mov(C,120,E)),Lookback) +Sum(Cross(C,Mov(C,150,E)),Lookback) +Sum(Cross(C,Mov(C,180,E)),Lookback);
ThumbsDown:= Sum(Cross(Mov(C,90,E),C),Lookback) +Sum(Cross(Mov(C,120,E),C),Lookback) +Sum(Cross(Mov(C,150,E),C),Lookback) +Sum(Cross(Mov(C,180,E),C),Lookback);
If(ThumbsUp>ThumbsDown,1,If(ThumbsUp<ThumbsDown,-1,0));
3. This will plot a binary indicator WITHOUT repeating the same signal -- modify it slightly for use in an Expert, by removing the INPUT statements and just set the variables: One version for a Buy or Sell "Signal" (Plot:=1), another (Plot:=2) for the "Season" TREND or HIGHLIGHTS. -------------------------------------------------------------------------
{* Signal/Season *} Lookback:=Input("Lookback",1,10000,1260); Plot:=Input("1=Signal 2=Season",1,2,1);
ThumbsUp:= Sum(Cross(C,Mov(C,90,E)),Lookback) +Sum(Cross(C,Mov(C,120,E)),Lookback) +Sum(Cross(C,Mov(C,150,E)),Lookback) +Sum(Cross(C,Mov(C,180,E)),Lookback);
ThumbsDown:= Sum(Cross(Mov(C,90,E),C),Lookback) +Sum(Cross(Mov(C,120,E),C),Lookback) +Sum(Cross(Mov(C,150,E),C),Lookback) +Sum(Cross(Mov(C,180,E),C),Lookback);
Buy:=ThumbsUp>ThumbsDown; Sell:=ThumbsUp<ThumbsDown;
{ LOGIC: Season means Signal is in effect }
init:=Cum(IsDefined(Buy+Sell))=1; flag:=ValueWhen(1,Buy-Sell<>0 OR init,Buy)*2-1; Signal:=If(flag<>Ref(flag,-1),flag,0); Season:=ValueWhen(1,Buy-Sell<>0,Buy)*2-1;
If(Plot=1,Signal,Season);
|