Ross hook code issue for plot signal


#1

Hi Everyone ,

here is a verified code but no plot for signal.
Would someone let me know please how to adjust the code for getting the signal.

Thank a lot for the help

Best,

Here the code

_SECTION_BEGIN("Hook Reversals");

slow =  LLV(Low, 6);
shigh = HHV(High, 6);

BFStp = Ref(Low,-1) == LLV(Low, 21); // Full Stop Buy
SFStp = Ref(High,-1) == HHV(High, 21); // Full Stop Sell

Buy3=HRbuy=BFStp AND O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1);
Short3=HRsell=SFStp AND O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1);

Sell3=C<O;
Cover3=C>O;

Buy3=ExRem(Buy3,Sell3);
Short3=ExRem(Short3,Cover3);
Sell3=ExRem(Sell3,Buy3);
Cover3=ExRem(Cover3,Short3);

PlotShapes(Buy3*shapeSquare, colorBlue, 0, L,Offset=-40);
PlotShapes(Buy3*shapeSquare,colorBlue, 0,L, Offset=-50); 
PlotShapes(Buy3* shapeUpArrow,colorWhite, 0,L, Offset=-45); 
PlotShapes(Short3* shapeSquare,colorRed, 0, H, Offset=40);
PlotShapes(Short3* shapeSquare,colorRed, 0,H, Offset=50); 
PlotShapes(Short3* shapeDownArrow,colorWhite, 0,H, Offset=-45);

PlotShapes(Sell3*shapeHollowDownArrow,colorPink,0,L,-45);
PlotShapes(Cover3*shapeHollowUpArrow,colorSkyblue,0,H,-45);

 
_SECTION_END();

_SECTION_BEGIN( "Price" );
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
_N( Title = StrFormat( "{{NAME}} - " + SectorID( 1 ) + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", colorRose, styleCandle | styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
_SECTION_END();

#2

@val2018, I would suggest adding the Exploration to your code. Then you can see what the variables are and determine where your code and your ideas are not matching.

Take a look here: How do I debug my formula? to see about the exploration and other helpful ideas.


#3

That is my code.

Here is the rest of my code.

/*Closing Price Reversals*/
CPRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L<Ref(L,-1) AND C>Ref(C,-1);
CPRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>Ref(H,-1) AND L>Ref(L,-1) AND C<Ref(C,-1);

/*Hook Reversals*/
HRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1);
HRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1);

/*Island Reversals*/
IRbuy=Ref(L,-2)>Ref(H,-1) AND L>Ref(H,-1); 
IRsell=Ref(H,-2)<Ref(L,-1) AND H<Ref(L,-1);

/*Key Reversals*/
KRbuy=O<Ref(C,-1) AND L<Ref(L,-1) AND C>Ref(H,-1);
KRsell=O>Ref(C,-1) AND H>Ref(H,-1) AND C<Ref(L,-1);

/*Open Close Reversals*/
OCRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L<Ref(L,-1) AND C<Ref(C,-1);
OCRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>Ref(H,-1) AND L>Ref(L,-1) AND C>Ref(C,-1);

/*Pivot Point Reversals*/
PPRbuy=Ref(L,-1)<Ref(L,-2) AND Ref(L,-1)<L AND C>Ref(H,-1);
PPRsell=Ref(H,-1)>Ref(H,-2) AND Ref(H,-1)>H AND C<Ref(L,-1);

#4

tks a lot for the code


#5

No problem. :grinning:


#6

Why do you have Buy3=HRbuy=BFStp and BFStp AND O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1)?
You are saying that Buy3 is equal to HRbuy and both of them are true when BFStp AND O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1).
You already said that HRbuy is equal to O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1) so this is what you wrote
Buy3=HRbuy=BFStp and HRbuy.


#7

Who? Me??????????????????????????????????????????? ? ?


#8

Sorry!
The question was for val2018.


#9

the code is not coming from me