PureBytes Links
Trading Reference Links
|
Treliff
Morning to you and the rest of the board, my question to you or any
that would like to explain "JANUS FACTOR" I can't find any relative
information on it. I am not trying to find how the calculation works
because I would not understand if I tried, I just would like to know
why would I us it and how to us it.
Thanks in advance
--- In amibroker@xxxxxxxxxxxxxxx, "treliff" <treliff@xxxx> wrote:
>
> Scott, I re-read Gary's article and still think it's a great
piece.
> I just altered the code a bit, more universal and readable. Discard
> the first code. Please read on below the code.
>
> /* code start */
>
> // ATC Scan, use filter Market/Group/Watchlist BENCHMARK'S UNIVERSE
> components
>
> // otr = off. target's return
> // dtr = def. target's return
> // obr = off. benchmark's return
> // dbr = def. benchmark's return
> // os = off. strength
> // ds = def. strength
> // cumos = cumulative off. strength
> // cumds = cumulative def. strength
>
> period = 100; // Set lookback period
> benchmark = "QQQ"; // Set benchmark
>
> Buy = Sell = Cover = Short = 0;
>
> x = Foreign(benchmark,"C");
>
> otr = IIf(x >= Ref(x,-1),ROC(C,1),0);
> dtr = IIf(x < Ref(x,-1),ROC(C,1),0);
>
> obr = IIf(x >= Ref(x,-1),ROC(x,1),0);
> dbr = IIf(x < Ref(x,-1),ROC(x,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);
>
> ------
>
> I remember having difficulty with Gary's scoring system, in
> particular when he writes that he divides a benchmark's return into
a
> target's return. If the benchmark is up 1% and a target is up 2%
that
> results in a score of 2, so far so good. But should a target be
down -
> 2% then the score would be -2, while the relative performance of
this
> target is obviously far worse. By instead subtracting the ROC's I
> tried to measure a balanced relative score. Any thoughts?
>
> -treliff
------------------------ 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/
|