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

Re: [amibroker] Daily and weekly system



PureBytes Links

Trading Reference Links

better to make it completely independent of the timeframe you are in like:

TimeFrameSet( inWeekly ); 
MA14_Weekly = MA( Close, 14 ); 
TimeFrameRestore(); 

TimeFrameSet( inDaily ); 
MA14_Daily = MA( Close, 14 ); 
TimeFrameRestore(); 

Buy=Cross(Close,TimeFrameExpand( MA14_Daily, inDaily )) AND Close > TimeFrameExpand( MA14_Weekly, inWeekly ); 
BuyPrice = Close; 

SetChartOptions(0, chartShowDates); 
Plot(C,"",colorWhite,64); 
PlotShapes(IIf(Buy,shapeUpArrow,0),colorWhite, layer = 0, yposition = BuyPrice, offset = 0 ); 
Plot(TimeFrameExpand( MA14_Weekly, inWeekly ),"",colorWhite,1); 
Plot(TimeFrameExpand( MA14_Daily, inDaily ),"",colorOrange,1); 



  ----- Original Message ----- 
  From: matrix10014 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, January 27, 2007 6:19 PM
  Subject: [amibroker] Daily and weekly system


  hi all,
  I am attempting to code multiple time frame systems.As an example,i am 
  coding a system where you enter long on a daily moving av xover only 
  if the close is > than the weekly MA..Does this look right??

  Has anyone found multiple time frame analysis useful??

  wc = TimeFrameCompress( Close, inWeekly ); 
  dailyma = MA( C, 14 ); 
  weeklyma = MA( wc, 14 );
  weeklyma = TimeFrameExpand( weeklyma, inWeekly ); 
  Buy=Cross(Close,MA(Close,14) AND Close>weeklyma);
  Sell=0;
  positionsize=-2;

  Thank you,

  Allan



   

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.12/653 - Release Date: 1/26/2007 11:11 AM