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

[amibroker] Furture Quotes



PureBytes Links

Trading Reference Links



I found this code on another web site.  I back tested it trading RUT 
and RYMKX.  The good news is that the results are great.  The bad 
news is the backtest reports that it references future quotes.  I 
can't figure out why?  I would appreciate any clues.

Thanks

p1   = Optimize("EMA Period",     8, 5, 25, 1);  //Period for EMA  
p2   = Optimize("DI+ DI- Period", 8, 5, 25, 1);  //Period for PDI 
and MDI 

//--------------------------------------------
// Change Price Array to Foreign Ticker so it
// will be used to create Buy and Sell Signals 
//--------------------------------------------
Signal_Symbol = ParamStr("Signal_Symbol", "!RUT");

SetForeign(Signal_Symbol);//-------------------------------------
// Long Buy Signal
//-------------------------------------
Cond1   = C > EMA(C,p1);

Cond2   = PDI(p2) > MDI(p2);

Buy     = Cond1 AND Cond2 ;
//------------------------------------
// Long Sell Signal
//------------------------------------
Sell  = C <= EMA(C,p1);

//------------------------------------
// Return prices to current ticker
//------------------------------------
RestorePriceArrays();

//---------------------------------------------
//  Create Equity Composite for Chart Analysis 
//---------------------------------------------
AddToComposite(Equity(0,0),"~TrendFollow", "X", 31);

//---------------------------------------------
// Exploration Code for detailed analysis of
// Signals (Buy, Sell, Cover, Short) 
//---------------------------------------------
Filter = 1;
AddColumn(C,"Close", 1.2);
AddColumn (Cond1,  "Cond1",1.0);
AddColumn (Cond2,  "Cond2",1.0);
AddColumn (Buy,    "Buy",  1, colorDefault, IIf(Buy, colorGreen, 
colorDefault));
AddColumn (Sell,   "Sell",  1, colorDefault, IIf(Sell,colorRed, 
colorDefault));










------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
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:
    http://docs.yahoo.com/info/terms/