PureBytes Links
Trading Reference Links
|
Hello
Try changing your BUY and SELL statements to...
Buy=Cross( array, RevRSI( value, array, WildPer ));
Sell=Cross(RevRSI( value, array, WildPer ), array);
Rick
--- In amibroker@xxxxxxxxxxxxxxx, "jism1992" <gdihia@xxxx> wrote:
> I added the buy and sell clause to the Reverse RSI formula so I can
> scan the crossovers, but I am getting several errors. Would someone
> help me convert this indicator into an exploration. I appreciate it.
>
> Here is the code:
>
> WildPer = Param("Wilder Time Periods", 14, 1, 100, 1 );
>
> Value = Param("RSI value", 50, 1, 100, 0.1 );
>
> Field = Param("Price Field (0-close, 1-high, 2-low)", 0, 0, 2, 1 );
>
> Mode = Param("Mode (0-RSI, 1-ReverseRSI)", 1, 0, 1, 1 );
>
> function RevRSI( value, array, periods )
>
> {
>
> AU = Wilders( Max( array - Ref( array, -1 ), 0 ), periods );
>
> AD = Wilders( Max( Ref( array, -1 ) - array, 0 ), periods );
>
> x = ( periods - 1 ) * ( AD * value / (100 - value) - AU);
>
> return IIf( x >= 0, array+x, array + x * (100 - value)/value );
>
> }
>
> array = IIf( Field == 0, Close, IIf( Field == 1, High, Low ) );
>
> aname = WriteIf( Field == 0, "Close", WriteIf( Field == 1, "High",
> "Low" ) );
>
> if( Mode == 0 ) /* RSI */
>
> {
>
> Plot( RSIa( array, WildPer ), "RSI( " + aname + ", " + WildPer
+ ")",
> colorRed );
>
> }
>
> else
>
> {
>
> Plot( array, aname, colorBlack );
>
> Plot( RevRSI( value, array, WildPer ), "ReverseRSI( " + aname
+ ", " +
> WildPer + ")", colorBlue, styleThick );
>
> }
>
> Buy=Cross(( array, aname, colorBlack ),(RevRSI( value, array,
WildPer ));
>
> Sell=Cross((RevRSI( value, array, WildPer ),( array, aname,
colorBlack ));
>
> Buy=ExRem(Buy,Sell);
>
> Sell=ExRem(Sell,Buy);
>
> PlotShapes(Buy*shapeUpArrow,colorGreen);
>
> PlotShapes(Sell*shapeDownArrow,colorYellow);
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|