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

Re: [amibroker] DMI Cross then wait for ADXR > 25



PureBytes Links

Trading Reference Links

can be done as follows:


// buy entry rules 
period = 8; 
ADXR = ( ADX( period ) + Ref( ADX( period ), -1 * period ) )/2; 
//ADXR = ADX( period); 

Buy = Cross(PDI( period),MDI( period )) AND BarsSince(ADXR > 25) <= 10;   
BuyPrice = Close; 

// chart 
SetChartOptions(0, chartShowDates); 
Plot(C,"C",colorWhite,64); 
PlotShapes(IIf(Buy,shapeUpArrow,0),colorWhite, layer = 0, yposition = BuyPrice, offset = 0 ); 






  ----- Original Message ----- 
  From: dralexchambers 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, January 30, 2007 11:15 AM
  Subject: [amibroker] DMI Cross then wait for ADXR > 25


  Hi,

  The system I am backtesting has the following buy rules:

  +DI Cross over -DI (8)

  this is signal day 1

  the second signal must come after the first:

  ADXR > 25

  The buy price is the close of this second signal.

  The point to note is that the second signal may come 1 or a maximum 
  of 10 days after the first signal. After 10 days, the entry is 
  invalid.

  How would I code this in AFL?

  Thanks - alex



   
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/655 - Release Date: 1/28/2007 1:12 PM