[R-SIG-Finance] Custom indicator for Quantstrat (Fractals by Bill Williams)

Dane Edwards daneedwards1 at hotmail.com
Thu Jul 2 14:24:59 CEST 2015

Hi, how do i create a custom indicator for quantmod / quantstrat. I'm trying to create a Fractal indicator (Bill Williams), the indicator needs to look back 5 days to calculate if a fractal has happened.
This is in MQL language
 //----Fractals up      FractalFound=false;      dCurrent=High[i];      if(dCurrent>High[i+1] && dCurrent>High[i+2] && dCurrent>High[i-1] && dCurrent>High[i-2])        {         FractalFound=true;        }//i is the current day

I'm not sure how the indicators work in quantstrat, in most backtesting software it loops through each day and calculates the indicator (for each day you then look back 5 days), does quanstrat do the same or do i need to write my own looping function in the indicator?
	[[alternative HTML version deleted]]

More information about the R-SIG-Finance mailing list