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

RE: [amibroker] SCAN for Spreads



PureBytes Links

Trading Reference Links




<FONT 
face="Courier New">Daniel
<BLOCKQUOTE 
>
  Is it possible with 
  Amibroker to scan the commodities market to find an interesting spread? 
  (one nearby future price getting higher than a more distant future?) Does 
  somebody trade commodities spreads? Some experience with analysis and 
  scanning?Regards.  
  Daniel           
  
I sometimes trade commodity spreads, but 
it doesn't seem to be that easy to chart and analyze them with 
AB.
 
I use the following formula to chart the 
spread and 3 EMAs:
 <SPAN 
class=360301511-24072003>

  spread = Close - <FONT 
  color=#0000ff>Foreign(<FONT 
  color=#0000ff>ParamStr(<FONT 
  color=#ff00ff>"2nd Symbol",<FONT 
  color=#ff00ff>"S`X"), <FONT 
  color=#ff00ff>"C" ); 

  
  Plot( spread, 
  "Spread", 
  colorYellow ); 
  Plot( 
  EMA( spread, 
  20 ), <FONT 
  color=#ff00ff>"20 EMA", colorOrange ); 
  
  Plot( 
  EMA( spread, 
  60 ), <FONT 
  color=#ff00ff>"60 EMA", colorRed ); 
  
  Plot( 
  EMA( spread, 
  120 ), <FONT 
  color=#ff00ff>"120 EMA", colorDarkRed 
  ); <FONT face=Arial 
  color=#0000ff> 
And the following to chart 
one price oscillator based on the spread.<FONT color=#000000 
size=1>

  spread = Close - <FONT 
  color=#0000ff>Foreign(<FONT 
  color=#0000ff>ParamStr(<FONT 
  color=#ff00ff>"2nd Symbol",<FONT 
  color=#ff00ff>"S`X"), <FONT 
  color=#ff00ff>"C" ); 

  oscillatorofspread = <FONT 
  color=#0000ff>EMA( spread, <FONT 
  color=#ff00ff>3 ) - <FONT 
  color=#0000ff>EMA( spread, <FONT 
  color=#ff00ff>10 ); <FONT 
  color=#0000ff>
  Plot( 
  oscillatorofspread , "", 
  IIf( oscillatorofspread 
  > 0 , 
  colorGreen , colorRed ) , styleHistogram ) 
  ;
  Plot( 
  oscillatorofspread , "Price Oscillator"<FONT 
  color=#000000>, IIf( 
  oscillatorofspread > 0 , 
  colorGreen , colorRed ) , styleNoLabel ) 
  ;
The problem I have found is that the 
first formula has the spread's second leg built in: so that every time you 
change it, it gets changed for every chart using the same formula.
As long as you chart, like I am doing 
Soybeans it works fine: I have August vs. November and Septmeber vs. November. 
The problem arises when I decide to chart KC Wheat vs. Chicago Wheat: I can't do 
it with the same formula, unless I enter a different contract name (instead of 
S`X) like WZ3, but this changes all the charts where I have the spread 
formula... Even those where S`X is OK.
So what am I planning to do? Build 
spread formulas for (let's say) soybeans, one for wheat, one for 
sugar...
A better solution would be to create a 
composite security, like it is done with Metastock... But so far I can't see 
how.
 
<FONT face=Arial color=#0000ff 
size=2>alberto






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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



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