Plot Buy arrow if Trigger is Equal or Less than 0.5 (Upper), trying many times

_SECTION_BEGIN("stochrsi cross");
Arrows = ParamToggle( "Buy/Sell Arrows", "No|Yes", 1 );
RSI_Length = Param( "RSI Length", 13, 1, 250, 1, 1 );
Stoc_Length = Param( "Stocastic Length", 8, 1, 250, 1, 1 );
WMA_Length = Param( "WMA Length", 6, 1, 40, 1, 1 );
BullSig = BearSig = Trigger = 0;

Upper = Param( "Upper", 0.5, 0.5, 1, 0.1 );
Lower = Param( "Lower", -0.5, 0, -0.5 -0.1 );

Value1 = RSIa( C, RSI_Length ) - LLV( RSIa( C, RSI_Length ), Stoc_Length );
Value2 = HHV( RSIa( C, RSI_Length ), Stoc_Length ) - LLV( RSIa( C, RSI_Length ), Stoc_Length );
Value3 = Nz( Value1 / Value2 );
Value4 = 2 * ( WMA( Value3, WMA_Length ) -0.5 );
Trigger = Ref( Value4, -1 );


BullSig = IIf( Cross( Value4, Trigger  ), True, False );
BearSig = IIf( Cross( Trigger, Value4  ), True, False );


Buy= BullSig;
Sell= BearSig;


Plot( Value4, "StocRSI", colorLightBlue );
Plot( Trigger, "Trigger", colorRed );
Plot( 0 , "", colorWhite, styleDashed );

if ( Arrows )
{
    PlotShapes(shapeUpArrow*BullSig, colorBrightGreen );   
    PlotShapes( shapeDownArrow*BearSig, colorRed ); 
}

Plot( Upper, "Upper", ParamColor( "ColorUpper", colorRed ), styleLine );
Plot( Lower, "Lower", ParamColor( "ColorLower", colorGreen ), styleLine );

_SECTION_END();

@jiten02 you have asked several questions on this forum and you have never, not once for any answer said "thank you". Never "liked" :heart: any help you have been given, and never marked any answer as the solution.
image

Each of your questions was in the title of your post with little to no explanation of what you have attempted as a solution that failed. I'm not sure why anyone would bother offering help. But maybe because this forum is full of great people you still get someone trying to help.

Your "arrows' are working the way you have coded them. You are plotting arrows when you get a BullSig and BearSig which are generated in these lines.

BullSig = IIf( Cross( Value4, Trigger  ), True, False );
BearSig = IIf( Cross( Trigger, Value4  ), True, False );

And then,

    PlotShapes(shapeUpArrow*BullSig, colorBrightGreen );   
    PlotShapes( shapeDownArrow*BearSig, colorRed ); 

To get arrows plotting at a different place you can either change how your BullSig and BearSig are calculated (so they are triggered at "0.5" if that's where you want the arrows) or you can change your PlotShapes code so the UpArrow and DownArrow are plotted when crossing 0.5 instead of BullSig and BearSig.

You're welcome.

5 Likes

Yep - well said! The lack of respect and lack of appreciation is a disgrace!

3 Likes

Well said!
Infact there are a few of them, probably I'd add them to this list until they rehab themselves to get out of it.

2 Likes

Yes and unfortunately some are also repeat offenders! See here.

1 Like