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

[amibroker] Re: Need to 'break'



PureBytes Links

Trading Reference Links




Herman,
 
When you mix SetForeign with TimeFrameSet (both 
functions write to built-in price arrays) it is important to maintain correct 
calling order.
First you should call SETFOREIGN (that instructs AB 
to use foreign ticker) and THEN TimeFrame functions.
Otherwise SetForeign() call OVERWRITES price arrays 
with UNCOMPRESSED data of foreign ticker.
 
Correct code is:
 
<FONT 
color=#0000ff>SetForeign(<FONT 
color=#ff00ff>"QQQ"); // 
THIS HAS TO PRECEDE TimeFrameSet<FONT 
color=#000000> TimeFrameSet<FONT 
color=#000000>(inDaily<FONT 
face="Courier New">); <FONT 
color=#000000>Buy=<FONT 
color=#0000ff>Cross( <FONT 
color=#0000ff>MACD(), <FONT 
color=#0000ff>Signal<FONT 
color=#000000>() ); Sell<FONT 
color=#000000> = Cross( 
Signal(), <FONT 
color=#0000ff>MACD() 
); TimeFrameRestore<FONT 
face="Courier New">(); <FONT 
color=#000000>Buy=<FONT 
color=#0000ff>TimeFrameExpand(<FONT 
color=#000000>Buy,<FONT 
color=#000000>inDaily<FONT 
color=#000000>); Sell<FONT 
color=#000000>=TimeFrameExpand<FONT 
color=#000000>(Sell<FONT 
color=#000000>,inDaily<FONT 
face="Courier New">); <FONT 
color=#000000>Short=<FONT 
color=#000000>Sell<FONT 
color=#000000>; Cover<FONT 
color=#000000>=Buy<FONT 
color=#000000>; 
Best regards,Tomasz 
Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Herman van den 
  Bergen 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">AmiBroker YahooGroups 
  Sent: Monday, May 10, 2004 6:46 PM
  Subject: [amibroker] Foreign() in 
  TimeFrames question
  
  Can somebody 
  explain how to use Foreign() and/or SetForeign() in Time Frames? 
  
  <SPAN 
  class=625373816-10052004> 
  We setting the 
  current stock to the QQQ and setting AA Periodicity to Daily the code below 
  gives expected results with and without the Foreign() statement. However 
  when setting my AA Periodicity to 1Minute the system doesn't seem to work. 
  
  <SPAN 
  class=625373816-10052004> 
  Can Foreign() and 
  SetForeign() be used within TimeFrames?
  <SPAN 
  class=625373816-10052004> 
  Thanks for any 
  help you can give!
  <SPAN 
  class=625373816-10052004>herman.
  <SPAN 
  class=625373816-10052004> 
  
  
  
  <SPAN 
  class=625373816-10052004>TimeFrameSet(inDaily);SetForeign("QQQ"); // 
  <<<<<<<<<<<<<<<<<<<Buy=Cross( 
  MACD(), Signal() );Sell = Cross( Signal(), MACD() 
  );TimeFrameRestore();Buy=TimeFrameExpand(Buy,inDaily);Sell=TimeFrameExpand(Sell,inDaily);Short=Sell;Cover=Buy;
  
  
  
  <SPAN 
  class=625373816-10052004> 
  <SPAN 
  class=625373816-10052004> Send BUG 
  REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------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 
  


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
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








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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 the Yahoo! Terms of Service.