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

[amibroker] Re: DeMark ROC2 Indicator



PureBytes Links

Trading Reference Links

Anybody using this indicator? If so could you answer a few questions
for me???

Thanks in advance.

Enoch

--- In amibroker@xxxxxxxxxxxxxxx, "Brian" <brian@xxx> wrote:
>
> 
> This is a variation of Tom DeMark's ROC2 indicator.
> 
> Play with the parameters to find which setting works best for the 
> given index or stock. I'd like to see a variation of this indicator 
> that automatically selects the best "VarPerc" setting for any ticker, 
> without having to use an kind of optimization. 
> 
> A quick visual check when your browse the different parameter 
> settings usually shows one or two settings that demonstrate 
> dependable support and resistance areas. Manually adjusting VarPerc 
> is not difficult, but it slows things down.
> 
> Post your variations of this or just email them to me. Thanks! Enjoy!
> 
> Bman
> 
> 
> /* Tom DeMark's Rate of Change 2 (TD ROC 2) Multiple*/
> 
> // Set A variables
> varOversoldSignal = 97.5; // default 97.5
> varOverboughtSignal = 107; // default 102.5
> varPeriod = 22;
> varThreshold = 100; // Param("thresh",1,1,100,1);  // default 100
> TDROC1 = (C/Ref(C,-(varPeriod)))*100;
> TDROC2 = IIf(TDROC1>varThreshold, (H/Ref(H,-(VarPeriod)))*100, (L/Ref
> (L,-(VarPeriod)))*100);
> //Plot(MA(TDROC2,4),"TDROC2",colorBlack,styleThick);
> 
> // Set B variables
> varBPeriod = 15;
> TDBROC1 = (C/Ref(C,-(varBPeriod)))*100;
> TDBROC2 = IIf(TDBROC1>varThreshold, (H/Ref(H,-(VarBPeriod)))*100, 
> (L/Ref(L,-(VarBPeriod)))*100);
> //Plot(MA(TDBROC2,4),"TDBROC2",colorBlue,styleThick);
> 
> // Set C variables
> varCPeriod = 10;
> TDCROC1 = (C/Ref(C,-(varCPeriod)))*100;
> TDCROC2 = IIf(TDCROC1>varThreshold, (H/Ref(H,-(VarCPeriod)))*100, 
> (L/Ref(L,-(VarCPeriod)))*100);
> //Plot(MA(TDCROC2,4),"TDCROC2",colorOrange,styleThick);
> 
> // Set D variables
> varDPeriod = 5;
> TDDROC1 = (C/Ref(C,-(varDPeriod)))*100;
> TDDROC2 = IIf(TDDROC1>varThreshold, (H/Ref(H,-(VarDPeriod)))*100, 
> (L/Ref(L,-(VarDPeriod)))*100);
> //Plot(MA(TDDROC2,4),"TDDROC2",colorWhite,styleThick);
> 
> VarROCFinal = (TDROC2*1.25+TDBROC2*1.15+TDCROC2*0.85+TDDROC2*0.75)/4;
> 
> // Buy Support Line
> x = Cum(1);
> VarPerc = Param("VarPerc",0.3,0.01,2.0,0.01); // default 0.3
> perchg = VarPerc*LastValue( Highest( ROC( VarROCFinal, 50 ) ));
> startvalue = LastValue( Trough( VarROCFinal, perchg, 1 ) );
> endvalue1 = LastValue( Trough( VarROCFinal, perchg, 2 ) );
> startbar = LastValue( ValueWhen( VarROCFinal== startvalue, x, 1 ) );
> endbar = LastValue( ValueWhen( VarROCFinal== endvalue1, x, 1 ) );
> Aa = (endvalue1-startvalue)/(endbar-startbar);
> b = startvalue;
> trendline = Aa * ( x  - startbar ) + b; 
> 
> // Short Resistance Line
> y = Cum(1);
> Bperchg = VarPerc*LastValue( Highest( ROC( VarROCFinal, 50 ) ));
> Bstartvalue = LastValue( Peak( VarROCFinal, Bperchg, 1 ) );
> Bendvalue1 = LastValue( Peak( VarROCFinal, Bperchg, 2 ) );
> Bstartbar = LastValue( ValueWhen( VarROCFinal== Bstartvalue, y, 1 ) );
> Bendbar = LastValue( ValueWhen( VarROCFinal== Bendvalue1, y, 1 ) );
> BAa = (Bendvalue1-Bstartvalue)/(Bendbar-Bstartbar);
> Bb = Bstartvalue;
> Btrendline = BAa * ( y  - Bstartbar ) + Bb; 
> 
> // Buy Settings
> varTDROC2_M_Buy = x >= endbar AND VarROCFinal<=1.01*trendline; // 
> bounce long support
> 
> // Short Settings
> varTDROC2_M_Short = y >= Bendbar AND VarROCFinal>=0.99*Btrendline; // 
> bounce long resistance
> 
> // Plot Colored Line
> Plot(VarROCFinal,"TDDROC2 Multiple",colorBlack,styleThick);
> Graph0BarColor=IIf(varTDROC2_M_Buy,colorBrightGreen,IIf
> (varTDROC2_M_Short,colorPink,colorBlack));
> 
> Plot( IIf( x >= endbar, trendline, Null ), "Trendline", colorYellow, 
> styleDots );
> Plot( IIf( y >= Bendbar, Btrendline, Null ), "Trendline", colorBlue, 
> styleDots );
> 
> //Plot(varOverboughtSignal,"",colorRed,styleThick);
> //Plot(varOversoldSignal,"",colorGreen,styleThick);
> 
> Title = "TDROC2";
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/