PureBytes Links
Trading Reference Links
|
Dave,
CCI is an Avg function.
Your request should go with
Plot(CCI(14),"CCI",4,1);
C=Foreign("^NDX","C");H=Foreign("^NDX","H");L=Foreign("^NDX","L");
Avg=(C+H+L)/3;
IndexCCI=CCIa(Avg,14);
Plot(IndexCCI,"IndexCCI",1,1);
Buy=Cross(-100,IndexCCI);
Sell=Cross(IndexCCI,100);
All buy/sell signals now will be produced by ^NDX [or any other
ticker you prefer] CCI crosses.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
wrote:
> can anyone tell me why these two tests give the same results for
every index
> I tried?
>
> both versions go long and short based on a CCI, optimizing for best
returns.
> version 1 uses the CCI of the issue under test, and version 2 uses
the CCI
> of another index, I thought.
>
> but I get the same results no matter what foreign index I use,
including
> contrarian ones like the VIX you see below.
>
> what am I missing?
>
> thanks,
>
> dave
>
>
> ----------------
> VERSION 1
> ----------------
> period = Optimize("period", 2, 1, 100, 1);
> threshold = Optimize("threshold", 25, 0, 100, 25);
>
> cc = CCI(period);
>
> Buy = Cross(cc, threshold);
> Sell = Cross(-threshold, cc);
> Short = Sell;
> Cover = Buy;
>
>
> ----------------
> VERSION 2
> ----------------
> period = Optimize("period", 2, 1, 100, 1);
> threshold = Optimize("threshold", 25, 0, 100, 25);
>
> saveO = O;
> saveH = H;
> saveL = L;
> saveC = C;
> saveV = V;
> O = Foreign("!VIX", "O");
> H = Foreign("!VIX", "H");
> L = Foreign("!VIX", "L");
> C = Foreign("!VIX", "C");
> V = Foreign("!VIX", "V");
> cc = CCI(period);
> O = saveO;
> H = saveH;
> L = saveL;
> C = saveC;
> V = saveV;
>
> Buy = Cross(cc, threshold);
> Sell = Cross(-threshold, cc);
> Short = Sell;
> Cover = Buy;
> ----------------
>
>
> Dave Merrill
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|