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

[amibroker] Newbie question



PureBytes Links

Trading Reference Links

I'm just getting started with AB and have been reading Kaufman's
Trading systems book.  It came with a CD with a number of easylanguage
programs for use in tradestation.  I'm not much at programming but I
was curious if it is very difficult to translate these programs to
AFL.   Here is an example of a breakout program in easylanguage:

TSM N-Day Breakout 2

This system uses function(s) found in Chapter 5 to generate trading
signals. Two inputs are required: the type of data (interest rates are
converted to approximate yields if types 2 and 3 are used), and the
number of periods to determine the highest high and lowest low for the
breakout signal.

{ TSM N-Day Breakout 2 
  Copyright 1994-2004, P J Kaufman. All rights reserved. }

{ type = 0, default, use price
	 1, 3-month rate
	 2, long-term rates
  period = length of calculation }

  input: type(0), period(20);
  vars:  phigh(0), plow(0), pclose(0), nhigh(0), nlow(0);

  phigh = high;
  plow = low;
  pclose = close;
  if type = 1 then begin
    phigh = 100 - low; { 3-month yield }
    plow = 100 - high;
    pclose = 100 - close;
    end;
  if type = 2 then begin
    phigh = 800/low;  { approx. bond yield }
    plow = 800/high;
    pclose = 800/close;
    end;
  nhigh = highest(phigh,period)[1];
  nlow  = lowest(plow,period)[1];
{ Buy and sell signals }
  if phigh > nhigh and pclose > pclose[1] then begin
	if type = 0 then buy on close else sell on close;
	end;
  if plow < nlow and pclose < pclose[1]  then begin
	if type = 0 then sell on close else buy on close;
	end;

thanks, Ken



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/