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

Re: [amibroker] Writing a "trading system"



PureBytes Links

Trading Reference Links




Hi Udo,
 
testing your code in explore mode with Comp-I, I 
got on some days all for conditions to be 1.
 
That can´t mean that I simultaneously buy, sell, 
cover AND short all on the same day, right?
 
But WHAT does in mean???
 
Markus
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=Udo.Harke@xxxxxxxxxxx 
  href="">Udo.Harke@xxxxxxxxxxx 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Friday, February 21, 2003 10:02 
  PM
  Subject: [amibroker] Writing a "trading 
  system"
  
  Hi Mr. IVA GMBH,
   
  this is what you really want to 
  do:
  <FONT face="Courier New" color=#009300 
  size=1>
  // The AFL library functions HHV() and LLV() consider the current bar as 
  well as the preceding ones and
  // therefore you must(!) use the equal to operator, ==:<FONT 
  face="Courier New" color=#00008b size=1><FONT face="Courier New" 
  color=#ff6820 size=1>
  buy = 
  HHV<FONT 
  face="Courier New" color=#00008b size=1>(<FONT face="Courier New" 
  color=#ff6820 size=1>high<FONT face="Courier New" color=#00008b 
  size=1>, 25<FONT 
  face="Courier New" color=#00008b size=1>) == <FONT 
  face="Courier New" color=#ff6820 size=1>high<FONT 
  face="Courier New" color=#00008b size=1>;<FONT 
  face="Courier New" color=#ff6820 size=1>
  sell = 
  LLV<FONT 
  face="Courier New" color=#00008b size=1>(<FONT face="Courier New" 
  color=#ff6820 size=1>low<FONT face="Courier New" color=#00008b 
  size=1>, 10<FONT 
  face="Courier New" color=#00008b size=1>) == <FONT 
  face="Courier New" color=#ff6820 size=1>low<FONT face="Courier New" 
  color=#00008b size=1>;<FONT face="Courier New" color=#ff6820 
  size=1>
  short = 
  LLV<FONT 
  face="Courier New" color=#00008b size=1>(<FONT face="Courier New" 
  color=#ff6820 size=1>low<FONT face="Courier New" color=#00008b 
  size=1>, 25<FONT 
  face="Courier New" color=#00008b size=1>) == <FONT 
  face="Courier New" color=#ff6820 size=1>low<FONT face="Courier New" 
  color=#00008b size=1>;<FONT face="Courier New" color=#ff6820 
  size=1>
  cover = 
  HHV<FONT 
  face="Courier New" color=#00008b size=1>(<FONT face="Courier New" 
  color=#ff6820 size=1>high<FONT face="Courier New" color=#00008b 
  size=1>, 10<FONT 
  face="Courier New" color=#00008b size=1>) == <FONT 
  face="Courier New" color=#ff6820 size=1>high<FONT 
  face="Courier New" color=#00008b size=1>;<FONT face="Courier New" 
  color=#009300 size=1>
  // This filter is very convenient for the exploration 
  mode:
  filter = 
  buy<FONT 
  face="Courier New" color=#00008b size=1> <FONT face="Courier New" 
  color=#ff6820 size=1>OR<FONT face="Courier New" color=#00008b 
  size=1> <FONT face="Courier New" color=#ff6820 
  size=1>sell 
  OR<FONT 
  face="Courier New" color=#00008b size=1> <FONT face="Courier New" 
  color=#ff6820 size=1>short<FONT face="Courier New" color=#00008b 
  size=1> <FONT face="Courier New" color=#ff6820 
  size=1>OR 
  cover<FONT 
  face="Courier New" color=#00008b size=1>;<FONT face="Courier New" 
  color=#009300 size=1>
  // Now you can see more data of a chosen stock received from the first 
  filter:
  // filter = 1;<FONT face="Courier New" color=#00008b 
  size=1>
  AddColumn<FONT face="Courier New" color=#00008b 
  size=1>(<FONT face="Courier New" color=#ff6820 
  size=1>buy, 
  "buy"<FONT 
  face="Courier New" color=#00008b size=1>, format = <FONT 
  face="Courier New" color=#ff00ff size=1>1.0<FONT face="Courier New" 
  color=#00008b size=1>);<FONT face="Courier New" color=#800080 
  size=1>
  AddColumn<FONT face="Courier New" color=#00008b 
  size=1>(<FONT face="Courier New" color=#ff6820 
  size=1>sell, 
  "sell"<FONT 
  face="Courier New" color=#00008b size=1>, format = <FONT 
  face="Courier New" color=#ff00ff size=1>1.0<FONT face="Courier New" 
  color=#00008b size=1>);<FONT face="Courier New" color=#800080 
  size=1>
  AddColumn<FONT face="Courier New" color=#00008b 
  size=1>(<FONT face="Courier New" color=#ff6820 
  size=1>short, 
  "short"<FONT 
  face="Courier New" color=#00008b size=1>, format = <FONT 
  face="Courier New" color=#ff00ff size=1>1.0<FONT face="Courier New" 
  color=#00008b size=1>);<FONT face="Courier New" color=#800080 
  size=1>
  AddColumn<FONT face="Courier New" color=#00008b 
  size=1>(<FONT face="Courier New" color=#ff6820 
  size=1>cover, 
  "cover"<FONT 
  face="Courier New" color=#00008b size=1>, format = <FONT 
  face="Courier New" color=#ff00ff size=1>1.0<FONT face="Courier New" 
  color=#00008b size=1>);
  Have fun IVA!
  Best regards,
  Udo
  <BLOCKQUOTE 
  >
    -----Ursprüngliche Nachricht----- 
    <DIV 
    >Von: 
    IVA GmbH 
    An: <A title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    Gesendet: Freitag, den 21. Februar 2003 
    17:36 Uhr
    Betreff: [amibroker] Writing a "trading 
    system"
    
    Hello,
     
    I´m trying to write a simple trading system to 
    get my feet wet with AB´s backtest ability.
     
    I want to buy when the high is higher than the 
    highest high of the last 25 days and sell and the low is lower then the last 
    10 days.
     
    On the short side, I want to short when the low 
    is lower than the lowest low ofthe preceeding 25 days and cover the position 
    when the high is higher than the highest high ofthe last 10 
    days.
     
    Why does this NOT work:
     
    
    Buy=<FONT 
    face="Courier New" color=#000000>High<FONT face="Courier New" 
    color=#6600aa>><FONT face="Courier New" 
    color=#0000ff>HHV<FONT face="Courier New" 
    color=#6600aa>(<FONT face="Courier New" 
    color=#000000>High<FONT face="Courier New" 
    color=#6600aa>,25<FONT 
    face="Courier New" color=#6600aa>);<FONT face="Courier New" 
    color=#000000>
    Sell=<FONT 
    face="Courier New" color=#000000>Low<FONT face="Courier New" 
    color=#6600aa><<FONT face="Courier New" 
    color=#0000ff>LLV<FONT face="Courier New" 
    color=#6600aa>(<FONT face="Courier New" 
    color=#000000>Low<FONT face="Courier New" 
    color=#6600aa>,10<FONT 
    face="Courier New" color=#6600aa>);<FONT face="Courier New" 
    color=#000000>
    Short=<FONT 
    face="Courier New" color=#000000>Low<FONT face="Courier New" 
    color=#6600aa><<FONT face="Courier New" 
    color=#0000ff>LLV<FONT face="Courier New" 
    color=#6600aa>(<FONT face="Courier New" 
    color=#000000>Low<FONT face="Courier New" 
    color=#6600aa>,25<FONT 
    face="Courier New" color=#6600aa>);<FONT face="Courier New" 
    color=#000000>
    Cover=<FONT 
    face="Courier New" color=#000000>High<FONT face="Courier New" 
    color=#6600aa>><FONT face="Courier New" 
    color=#0000ff>HHV<FONT face="Courier New" 
    color=#6600aa>(<FONT face="Courier New" 
    color=#000000>High<FONT face="Courier New" 
    color=#6600aa>,10<FONT 
    face="Courier New" color=#6600aa>);Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)Check 
    group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
    Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT









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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.