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

[amibroker] Using timeframeset with looping code



PureBytes Links

Trading Reference Links

I cannot seem to get the timeframeset to work with any code that contains loops.
I want to explore on weekly values for setups, then trade on daily
values breaking the weekly setups. This is especially important as I
am trying to backtest for this code. Rather than post a long code that
would take time to work through I have put together a simple formula
that will return the highest close, just purely as an example. I can
get values if I set the AA settings to weekly, but if put to daily I
get empty cells in the exploration.
Can someone help me on how to get this to work

TimeFrameSet(inWeekly);
x[0]=C[0];
for(i=1;i<BarCount;i++)
{ if(C[i]>x[i-1])
{ x[i]=C[i];
}
else
{ x[i]=x[i-1];
} }
TimeFrameRestore();

xx = TimeFrameExpand( x, inWeekly );

Filter=1;
AddColumn(C,"close",1.3);
AddColumn(x,"x",1.3);
AddColumn(xx,"xx",1.3);

-- 
Cheers
Graham
http://e-wire.net.au/~eb_kavan/


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/