ROC Indicator Strategy (Amibroker And Tradestation Code)
The article can be found here.
Oversold:
oddis=Optimize(“ROC”,4,2,14,2) ;
Buy = RSIa(ROC(Close,oddis),10)<35;
BuyPrice=Close;
Sell = C>Ref(H,-1);
SellPrice= Close;
Breakout:
oddis=Optimize(“ROC breakout N-days”,10,10,30,2) ;
ROCbreakout = ROC(C,4) ;
Buy = Cross(ROCbreakout,Ref(HHV(ROCbreakout,oddis),-1));
BuyPrice=Close;
Sell = 0;
SellPrice= Close;
applyStop(stopTypeNBar,stopModeBars,20,1);
Zero line cross:
oddis=Optimize(“ROC zero line cross N-days”,4,2,14,2) ;
Buy = Cross(0,ROC(Close,oddis)) ;
BuyPrice=Close;
Sell = Cross(ROC(Close,oddis),0) ;
SellPrice= Close;
Tradestation code:
{
Strategy 125A - ROC indicator trading strategy
We calculate the RSI of the ROC indicator.
When the the RSI of the ROC crosses below 35, we enter at the close.
We sell at the close when the close is higher than yesterday’s high.
}
Inputs:
RocLookback(4),
RsiLookback(10),
BuyTreshold(35);
if RSI(RateOfChange(Close, RocLookback), RsiLookback) < BuyTreshold Then
buy this bar on close;
if Close > High[1] then
sell this bar on close;
---------------------------------------------------------------------------------
{
Strategy 125B - ROC indicator trading strategy
We use a 4-day ROC.
When the ROC breaks above the 10-day high of ROC, we go long at the close.
We sell 20 days later at the close.
}
Inputs:
RocLookback(4),
HighestLookback(10);
Vars:
RocBreakout(0);
RocBreakout = RateOfChange(Close, RocLookback);
if RocBreakout cross over Highest(RocBreakout, HighestLookback)[1] Then
buy this bar on close;
if Barssinceentry(0) >= 20 then
sell this bar on close;
------------------------------------------------------------------------
{
Strategy 125C - ROC indicator trading strategy
We go long when the N-day ROC crosses BELOW zero.
We sell at the close when the N-day ROC crosses ABOVE zero.
}
Inputs:
RocLookback(4);
Vars:
Roc(0);
Roc = RateOfChange(Close, RocLookback);
if Roc cross under 0 Then
buy this bar on close;
if Roc cross over 0 then
sell this bar on close;
