[R-SIG-Finance] Custom indicator for Quantstrat (Fractals by Bill Williams)
Ilya Kipnis
Ikipnis at grahamcapital.com
Thu Jul 2 14:42:43 CEST 2015
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.
More information about the R-SIG-Finance
mailing list