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

[amibroker] Portfolio backtester and setting a delay



PureBytes Links

Trading Reference Links

You may overcome the customization if you write your own indicators
in a way like this (stochastics, for example):

function stochastics(array, stochPeriods)
{
   k = (array - llv(array, stochPeriods) - ...
   ...
}

setMode   = Param("1) Mode", 0, 0, 1, 1);
IndexBase = ParamStr("2) Index base", "^QQQ");
Periods   = Param("3) Stoch Periods", .... );

Pair      = C / Foreign(IndexBase, "C");
Array     = iif(setMode == 0, Close, Pair);

Plot(stochastics(Array, Periods), "Stochastics " + WriteIf(setMode ==
1, Name() + " / " + IndexBase, ""), colorblue, styleline);

This way your indicator works on default on the main ticker but when
necessary it may be switched to the pair.

Franco

--- In amibroker@xxxxxxxxxxxxxxx, "hoolee0820" <hoolee0820@xxxx>
wrote:
> 
> 
> Thanks for the help folks. using Foreign() functions also was the 
> solution I first came up with. The problem is any studies inserted 
> into the chart apply only to first symbol (QQQ as in QQQ/SMH pair), 
> not to the pair itself. QQQ/SMH is not treated as ONE new single 
> symbol, all indicators need to be customized.
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> > You might also have a look at the built-in relstrength
function....
> > 
> > Regards,
> > 
> > Jayson
> > 
> >   -----Original Message-----
> >   From: Franco Gornati [mailto:francogornati@x...]
> >   Sent: Sunday, May 16, 2004 1:35 PM
> >   To: amibroker@xxxxxxxxxxxxxxx
> >   Subject: [amibroker] Re: Charting a pair
> > 
> > 
> >   I'm not sure but I think you mean something like this
> > 
> >   IndexBase = ParamStr("Index base", "^QQQ");
> >   Pair      = C / Foreign(IndexBase, "C");
> >   PLot(Pair, "Pair " + Name() + " / " + IndexBase, colorblack, 
> styleline);
> > 
> >   This way you can plot the relative performance of your tickers 
> against
> > QQQ. You may change the base using the parameters window.
> > 
> >   Franco
> > 
> > 
> >   "olivier_molongo" <olivier_molongo@xxxx> wrote
> >   >
> >   >I am also interesting in getting the answer to that question.
Can
> >   >somebody help on that?
> >   >
> >   >
> >   >
> >   >--- In amibroker@xxxxxxxxxxxxxxx, "hoolee0820"
<hoolee0820@xxxx>
> >   >wrote:
> >   >> Hi,
> >   >>
> >   >> I'm new to AB, but searching the archives didn't seem to
give 
> the
> >   >> answer to my simple question:
> >   >>
> >   >> In Qcharts I can type in a symbol like "SMH / QQQ" to chart
a 
> pair,
> >   >> and all indicators work on this new symbol at onece without
any
> >   >> modifications. How do I do this in AB?
.



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