PureBytes Links
Trading Reference Links
|
Here is one way. I am sure you will see ways to modify it.
p1 = optimize("period1",1,1,5,1);// 1 day to 1 week
p2 = p1*2 ; // builds on p1
p3 = p2*2 ; // builds on p2
Buy =
C > Ref(C, -p1) AND
Ref(C, -p1) > Ref(C, -p2) AND
Ref(C, -p2) > Ref(C, -p3);
// When p1=1, p2=2 and p3=4
// When p1=2, p2=4 and p3=8
// etc.
// When p1=5, p2=10 and p3=20
--- Keith Osborne <kosborn3@xxxxxxxxxxxxxx> wrote:
> Hi, the following gives me a buy condition if there are 3
> successive
> higher highs.
>
> Buy = C > Ref(C, -1) AND Ref(C, -1) > Ref(C, -2) AND
> Ref(C, -2) >
> Ref(C, -3); /* 3 increased closes in a row */
>
> What I would like to do is optimize or param this so that
> I can backtest
> over a shorter/longer lookback, say 2 to 6 periods. How
> can I do this
> other than by a long string of Ref(c, -X) type
> conditions. Do I have to
> enter the world of loops (something I can't do).
>
> TIA.........Keith
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.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/
|