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

Re: [amibroker] Programming a simple multi-timeframe strategy like 3 Ducks



PureBytes Links

Trading Reference Links

Am pasting below code that will show you how to define multiple time frame moving averages. Just have to add plot statements and you are good to go if you are plotting on a chart below daily time frame. This code will give you daily and weekly moving averages(daily and weekly being the higher time frames) on a chart that is of a resolution lower than daily time frame. You will have to modify it for your specific application .


Best Regards


Rakesh


SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorDarkBlue ), styleCandle);


PRC=C;


MA1=MA(PRC,8);
MA2=MA(PRC,16);


TimeFrameSet(inDaily);

D_PRC=C;
D_MA1=MA(d_PRC,8);
D_MA2=MA(d_PRC,16);

TimeFrameRestore();

D_MA1=TimeFrameExpand(D_MA1,inDaily);
D_MA2=TimeFrameExpand(D_MA2,inDaily);


TimeFrameSet(inWeekly);

w_PRC=C;

W_MA1=MA(w_PRC,8);
W_MA2=MA(w_PRC,16);

TimeFrameRestore();

W_MA1=TimeFrameExpand(W_MA1,inWeekly);
W_MA2=TimeFrameExpand(W_MA2,inWeekly);


On Mon, Jun 16, 2008 at 2:38 PM, Herman <psytek@xxxxxxxx> wrote:

AmiBroker has extensive multi-time frame capabilities, see functions like TimeFrame...() and see http://www.amibroker.com/docs/MTFIndicators.html There are also many other examples around.


Real-Time trading can be done using the Interactive Broker Controller, see http://www.amibroker.com/at/ for more information. You can easily place orders of many types and monitor their execution in real time. On chart system status displaying, trade logging, and even verbal reporting using the Say() is possible. You are in for an exciting time :-)


Be prepared to spend some time developing Trade Automation code; the problem lies not with AmiBroker but with other practical issues. For more tips on Auto-trading see http://www.amibroker.org/userkb/, especially the Real Time trading section http://www.amibroker.org/userkb/category/real-time-afl-applications/ Of course you need a real-time data feed, like eSignal.


If you are really stuck there are many friendly people on this list willing to get you started - after you have researched the user manual ;-) see http://amibroker.com/guide/


Welcome to our AB community,

Good luck,

herman


For tips on developing Real-Time Auto-Trading systems visit:

http://www.amibroker.org/userkb/


Saturday, June 14, 2008, 1:57:54 PM, you wrote:


> This is a newbie question. I am considering purchasing AmiBroker

> Professional. I am not a programmer but can handle basic technical

> stuff, and will learn AFL.


> I want to know if it is even possible to program something like the "3

> Ducks Trading Method" with FOREX and eventually automate it.


> http://captaincurrency.blogspot.com/2007/01/3-ducks-trading-system.html


> Basically 3 Ducks involves testing SMA conditions on 4 hour, 1hour and

> 5 minute charts before determining the entry. Is this even possible or

> can AmiBroker AFL strategies only work with one time frame at a time?


> If it is possible to build such a simple multi-time frame strategy,

> can I then easily backtest it with historical data in an automated

> mode, using intra-day data? Or do I need to manually switch the time

> frames as the backtest proceeds?


> Can something like the 3 Ducks system be fully automated in AmiBroker

> to trade live? I don't plan on doing that any time soon, just want to

> know if it is even possible with this software.


> Thanks!



> ------------------------------------


> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:

> http://www.amibroker.com/devlog/


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


> <*> Your email settings:

>     Individual Email | Traditional


> <*> To change settings online go to:

>     http://groups.yahoo.com/group/amibroker/join

>     (Yahoo! ID required)


> <*> To change settings via email:

>     mailto:amibroker-digest@xxxxxxxxxxxxxxx 

>     mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx


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



__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___