[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: The Janus Factor



PureBytes Links

Trading Reference Links


Scott, I did a while ago. Never checked back, but since you mentioned 
it, reading his article it is one of those rare technical studies 
that makes sense to me (one of the few I understand? ;-).  

I dug it up and will take a fresh look. I remember shifting the 
neutral point from (100,100) to (0,0). Also I split the X and Y 
coordinates, most will speak for itself.  

I also remember the resulting charts at first sight did not seem very 
revealing. Perhaps I interpreted something wrong in Gary's 
analysis.    

I'll just give the code as is, appreciate any remarks or suggestions. 
This was made specifically for the NAS100 with QQQ as benchmark. 

/* code start */

// ATC Scan, use filter Market/Group/Watchlist NAS100 components

// otr = off. target's return 
// dtr = def. target's return 
// odr = off. benchmark's return 
// dbr = def. benchmark's return 
// os = off. strength
// ds = def. strength
// cumos = cumulative off. strength
// cumds = cumulative def. strength


Buy = Sell = Cover = Short = 0;

period = 100;  // Set lookback period

otr = IIf(Foreign("QQQ","C") >= Ref(Foreign("QQQ","C"),-1),ROC
(C,1),0);
dtr = IIf(Foreign("QQQ","C") < Ref(Foreign("QQQ","C"),-1),ROC(C,1),0);

obr = IIf(Foreign("QQQ","C") >= Ref(Foreign("QQQ","C"),-1),ROC(Foreign
("QQQ","C"),1),0);
dbr = IIf(Foreign("QQQ","C") < Ref(Foreign("QQQ","C"),-1),ROC(Foreign
("QQQ","C"),1),0);

os = otr-obr;
ds = dtr-dbr;

cumos = Sum(os,period);
cumds = Sum(ds,period);

cumos_NE = IIf(cumos >= -cumds,cumos,0);
cumos_SW = IIf(cumos <= -cumds,cumos,0);
cumds_NE = IIf(cumos >= -cumds,cumds,0);
cumds_SW = IIf(cumos <= -cumds,cumds,0);

AddToComposite(cumos_NE,"~janus","O");
AddToComposite(cumos_SW,"~janus","H");
AddToComposite(cumds_NE,"~janus","L");
AddToComposite(cumds_SW,"~janus","C");
//AddToComposite(IIf(cumos >= -cumds,1,0),"~janus","V");
//AddToComposite(IIf(cumos <= -cumds,1,0),"~janus","I");

/* code end */


// Indicator Janus NorthEast

Plot(Foreign("~janus","O"),"Off.Strength_NE",colorGreen);
Plot(Foreign("~janus","L"),"Def.Strength_NE",colorTurquoise);
Plot(0,"",colorBlack); 


// Indicator Janus SouthWest

Plot(Foreign("~janus","H"),"Off.Strength_SW",colorRed);
Plot(Foreign("~janus","C"),"Def.Strength_SW",colorLightOrange);
Plot(0,"",colorBlack);


-treliff


--- In amibroker@xxxxxxxxxxxxxxx, "sgearhart12000" <sgearhart1@xxxx> 
wrote:
> 
> Has anyone programed the Janus Factor, by Gary Anderson, into AB? I 
> just started to look into this stock selection method.
> Thanks
> Scott





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/