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

Dane Edwards daneedwards1 at hotmail.com
Fri Jul 3 01:44:46 CEST 2015


Thanks Ilya, does the indicator function get called for every row (like esignal, ninjatrader)  in the xts when the apply strategy function is called? or is the indicator function called once?
i'm thinking now that the indicator column is calculated before applystrategy is ran, is this correct?

 

> From: Ikipnis at grahamcapital.com
> To: daneedwards1 at hotmail.com; r-sig-finance at r-project.org
> Subject: RE: [R-SIG-Finance] Custom indicator for Quantstrat (Fractals by Bill	Williams)
> Date: Thu, 2 Jul 2015 12:42:43 +0000
> 
> Indicators are just functions like any other R function. EG the quantstrat demos use a lot of the TTR functions, but those TTR are functions are just R functions themselves.
> 
> -----Original Message-----
> From: R-SIG-Finance [mailto:r-sig-finance-bounces at r-project.org] On Behalf Of Dane Edwards
> Sent: Thursday, July 02, 2015 8:25 AM
> To: r-sig-finance at r-project.org
> Subject: [R-SIG-Finance] Custom indicator for Quantstrat (Fractals by Bill Williams)
> 
> 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.
> http://www.winnersedgetrading.com/how-to-trade-the-fractal-indicator/
> 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?
> Thanks!! 		 	   		  
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list