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

[amibroker] Re: optimizing trades based on a foreign CCI not working as expected



PureBytes Links

Trading Reference Links

Jayson, Dave,
things are simplified now with the fresh  SetForeign() function.
Example
 SetForeign( "MSFT" );
dm = CCI(); // dm holds CCI of MSFT regardless of currently selected 
symbol
RestorePriceArrays();
Plot( dm, "CCI of MSFT", colorRed );
Plot( CCI(), "CCI of " + Name(), colorBlue );
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Jayson,
> My reply was not thoeretical but experimental.
> I donīt know why. [Tomasz know the internal CCI script].
> The code I provided can do the job, the alternatives with Foreign
> ("^NDX","C") do not solve the situation described by Dave.
> Dimitris Tsokakis
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> > Dimitris,
> > If CCI averages and you have renamed OHL to foreign values then 
why 
> would
> > not simply CCI(14) return the CCI for that foreign call?
> > 
> > Also does CCIa(foreign("^NDX","C") assume that the close value is 
> in fact
> > the average or is it making a calculation on its own to create 
the 
> average?
> > 
> > While the description at TA A_Z supports your position that an 
> average of
> > C+H+L is required the AB documentation leads one to believe that 
a 
> single
> > value ( "Values other than Close") can be used.
> > 
> > Regards,
> > Jayson
> > -----Original Message-----
> > From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@x...]
> > Sent: Tuesday, September 02, 2003 2:55 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: optimizing trades based on a foreign CCI 
> not
> > working as expected
> > 
> > 
> > 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
> > 
> > 
> > 
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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 the Yahoo! Terms of 
Service.


------------------------ 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/