Has anybody seen Hawkeye indicator equivalent in afl?

xsis

Active Member
#81
dude chill maar!

i posted here coz few of the MT4 indi's codes posted here by many and specially you here had this decompiler name in it. so thot tht if any one of them including you cud help! but if you dont wanna help, i cant help it!

btw didnt knw mods ban ppl like this. even if they - i care a damn :annoyed:

xsis

I dont know what to say
you seem to be like a man having account in ICICI BANK BUT GO TO HDFC BANK AND ASK FOR MONEY.
This is an amibroker area and you demand metatrader stuff here.
do you want the moderator to ban you?
 

KelvinHand

Well-Known Member
#82
hI Mastermind007


PHP:
//mastermind007  3bar pivots

upperPivot = (Ref(High, -1) >= High AND Ref(High, -2) <= Ref(High, -1) AND Ref(Low, -1) >= Low AND Ref(Low, -2) <= Ref(Low, -1)) ;
lowerPivot = (Ref(High, -1) <= High AND Ref(High, -2) >= Ref(High, -1) AND Ref(Low, -1) <= Low AND Ref(Low, -2) >= Ref(Low, -1)) ;
PlotShapes(upperPivot * shapeDownTriangle + lowerPivot * shapeUpTriangle, IIf(upperPivot, colorRed, colorBlue), 0, IIf(upperPivot, High, Low), -12);
ford
After looking at the MT4 code, I think the plotting is more logical.
This is how the pivot is doing for the 3-bars pivots
- The upper pivot bar must be both High and Low higher then both side.
- The lower pivot bar must be both High and Low lower then both side.

Further confirmation on the TS manual on the Pivots picture, it is same as in MT4.
I suppose the TS code was modified .


So change the following in the above Script

1. Change all the ">=" to ">"
2. Change all the "<=" to "<"
3. do a reference future shift 1 to the upper and lower pivots will show proper pivots
 
Last edited:
#83
Hi KelvinHand

Wish you and all traderji members a very happy new year.

picked up your hint as you say
HTML:
So change the following in the above Script

1. Change all the ">=" to ">"
2. Change all the "<=" to "<"
3. do a reference future shift 1 to the upper and lower pivots will show proper pivots
I hope you say the following is the code lines.

HTML:
upperPivot = (Ref(High, -1) > High AND Ref(High, -2) < Ref(High, -1) AND Ref(Low, -1) > Low AND Ref(Low, -2) < Ref(Low, -1)) ;
lowerPivot = (Ref(High, -1) < High AND Ref(High, -2) > Ref(High, -1) AND Ref(Low, -1) < Low AND Ref(Low, -2) > Ref(Low, -1)) ;
UPpivotfinal =ref(upperpivot,-1);
LOpivotfinal =Ref(lowerpivot,-1);
PlotShapes(UPPivotfinal * shapeDownTriangle + LOPivotfinal * shapeUpTriangle, IIf(upperPivot, colorRed, colorBlue), 0, IIf(upperPivot, High, Low), -12);
please confirm at leisure if this is ok & goes in right perspective.
hERE IS SOMETHING -is it worth? Dont know. just tried. need to be perfected yet
HTML:
SetChartBkColor(colorDarkBlue);


Plot(Close,"close",colorWhite,styleBar);

//MODIFIED PIVOTS
upperPivot = (Ref(High, -1) > High AND Ref(High, -2) < Ref(High, -1) AND Ref(Low, -1) > Low AND Ref(Low, -2) < Ref(Low, -1)) ;
lowerPivot = (Ref(High, -1) < High AND Ref(High, -2) > Ref(High, -1) AND Ref(Low, -1) < Low AND Ref(Low, -2) > Ref(Low, -1)) ;
UPpivotfinal =Ref(upperpivot,-1);
LOpivotfinal =Ref(lowerpivot,-1);
PlotShapes(UPPivotfinal * shapeSmallCircle + LOPivotfinal * shapeSmallCircle, IIf(UPPivotfinal, colorRed, colorBrightGreen), 0, IIf(UPPivotfinal, High, Low), -12);  
//how to get white dots when price is below UPpivotfinal AND ABOVE LOpivotfinal  ? 

//by kelvinhand
function XManh(Price, Len, LenSXMA)
{
   return EMA(EMA(Price,Len), LenSXMA);
}
//Price=Close;
//Len =5;LenSXMA =5;
Plot(Xmanh(Close,5,5),"XMANH(CLOSE,5,5)",colorRed,styleThick);
kk = Xmanh(C,5,5);

//ATRlevels for stops  based on 1.75*ATR
LongStop = HHV( KK - 1.75 * ATR(10), 15 );
AA = Plot(LongStop,"IF C ABOVE REDLINE,LongStop",colorRed,8+16);
ShortStop = LLV(KK + 1.75* ATR(10),15);
//BB = Plot(ShortStop,"IF C BELOW REDLINE,ShortStop",colorYellow,8+16);
//to improve code to plot only longstop or only shortstop at one time

//IIf(C>KK,AA,BB);//CANT GET THIS PLOT RIGHT  TO PLOT ONLY LONGSTOP WHEN UPTREND AND PLOT ONLY SHORTSTOP WHEN DOWNTREND-PLEASE HELP
Plot(LongStop,"IF C ABOVE REDLINE,LongStop",colorRed,8+16);
regards
ford
 
Last edited:

KelvinHand

Well-Known Member
#84
Hi KelvinHand

Wish you and all traderji members a very happy new year.

picked up your hint as you say
HTML:
So change the following in the above Script

1. Change all the ">=" to ">"
2. Change all the "<=" to "<"
3. do a reference future shift 1 to the upper and lower pivots will show proper pivots
I hope you say the following is the code lines.

HTML:
upperPivot = (Ref(High, -1) > High AND Ref(High, -2) < Ref(High, -1) AND Ref(Low, -1) > Low AND Ref(Low, -2) < Ref(Low, -1)) ;
lowerPivot = (Ref(High, -1) < High AND Ref(High, -2) > Ref(High, -1) AND Ref(Low, -1) < Low AND Ref(Low, -2) > Ref(Low, -1)) ;
UPpivotfinal =ref(upperpivot,-1);
LOpivotfinal =Ref(lowerpivot,-1);
PlotShapes(UPPivotfinal * shapeDownTriangle + LOPivotfinal * shapeUpTriangle, IIf(upperPivot, colorRed, colorBlue), 0, IIf(upperPivot, High, Low), -12);
please confirm at leisure if this is ok & goes in right perspective.
hERE IS SOMETHING -is it worth? Dont know. just tried. need to be perfected yet
HTML:
SetChartBkColor(colorDarkBlue);


Plot(Close,"close",colorWhite,styleBar);

//MODIFIED PIVOTS
upperPivot = (Ref(High, -1) > High AND Ref(High, -2) < Ref(High, -1) AND Ref(Low, -1) > Low AND Ref(Low, -2) < Ref(Low, -1)) ;
lowerPivot = (Ref(High, -1) < High AND Ref(High, -2) > Ref(High, -1) AND Ref(Low, -1) < Low AND Ref(Low, -2) > Ref(Low, -1)) ;
UPpivotfinal =Ref(upperpivot,-1);
LOpivotfinal =Ref(lowerpivot,-1);
PlotShapes(UPPivotfinal * shapeSmallCircle + LOPivotfinal * shapeSmallCircle, IIf(UPPivotfinal, colorRed, colorBrightGreen), 0, IIf(UPPivotfinal, High, Low), -12);  
//how to get white dots when price is below UPpivotfinal AND ABOVE LOpivotfinal  ? 

//by kelvinhand
function XManh(Price, Len, LenSXMA)
{
   return EMA(EMA(Price,Len), LenSXMA);
}
//Price=Close;
//Len =5;LenSXMA =5;
Plot(Xmanh(Close,5,5),"XMANH(CLOSE,5,5)",colorRed,styleThick);
kk = Xmanh(C,5,5);

//ATRlevels for stops  based on 1.75*ATR
LongStop = HHV( KK - 1.75 * ATR(10), 15 );
AA = Plot(LongStop,"IF C ABOVE REDLINE,LongStop",colorRed,8+16);
ShortStop = LLV(KK + 1.75* ATR(10),15);
//BB = Plot(ShortStop,"IF C BELOW REDLINE,ShortStop",colorYellow,8+16);
//to improve code to plot only longstop or only shortstop at one time

//IIf(C>KK,AA,BB);//CANT GET THIS PLOT RIGHT  TO PLOT ONLY LONGSTOP WHEN UPTREND AND PLOT ONLY SHORTSTOP WHEN DOWNTREND-PLEASE HELP
Plot(LongStop,"IF C ABOVE REDLINE,LongStop",colorRed,8+16);
regards
ford
i say do a reference future shift 1.

I say future, not past.
I say shift 1, not -1.

before the PlotShapes

you must see a star on a x'mas tree.
 
#85
Hi KelvinHand

Thank you for the prompt correction & very soon.
Sorry that I understood but not understood in the moments excitement that I am near to goal by one more solid step with your help.

Still to get the atr stop dots rightly plotted.
best regards
ford
HTML:
SetChartBkColor(colorDarkBlue);


Plot(Close,"close",colorWhite,styleBar);

//MODIFIED PIVOTS
upperPivot = (Ref(High, -1) > High AND Ref(High, -2) < Ref(High, -1) AND Ref(Low, -1) > Low AND Ref(Low, -2) < Ref(Low, -1)) ;
lowerPivot = (Ref(High, -1) < High AND Ref(High, -2) > Ref(High, -1) AND Ref(Low, -1) < Low AND Ref(Low, -2) > Ref(Low, -1)) ;
UPpivotfinal =Ref(upperpivot,1);
LOpivotfinal =Ref(lowerpivot,1);
PlotShapes(UPPivotfinal * shapeSmallCircle + LOPivotfinal * shapeSmallCircle, IIf(UPPivotfinal, colorRed, colorBrightGreen), 0, IIf(UPPivotfinal, High, Low), -12);  
//how to get white dots when price is below UPpivotfinal AND ABOVE LOpivotfinal  ? 

//by kelvinhand
function XManh(Price, Len, LenSXMA)
{
   return EMA(EMA(Price,Len), LenSXMA);
}
//Price=Close;
//Len =5;LenSXMA =5;
Plot(Xmanh(Close,5,5),"XMANH(CLOSE,5,5)",colorRed,styleThick);
kk = Xmanh(C,5,5);

//ATRlevels for stops  based on 1.75*ATR
LongStop = HHV( KK - 1.75 * ATR(10), 15 );
AA = Plot(LongStop,"IF C ABOVE REDLINE,LongStop",colorRed,8+16);
ShortStop = LLV(KK + 1.75* ATR(10),15);
//BB = Plot(ShortStop,"IF C BELOW REDLINE,ShortStop",colorYellow,8+16);
//to improve code to plot only longstop or only shortstop at one time

//IIf(C>KK,AA,BB);//CANT GET THIS PLOT RIGHT  TO PLOT ONLY LONGSTOP WHEN UPTREND AND PLOT ONLY SHORTSTOP WHEN DOWNTREND-PLEASE HELP
Plot(LongStop,"IF C ABOVE REDLINE,LongStop",colorRed,8+16);
 

KelvinHand

Well-Known Member
#88
Hawkeye_WideBar Indicator

Based on MT4:
PHP:
//-- HawkEye_WideBar -- by Kelvinhand
Range= H-L;
WB = Range > 2*MA(Range, 10);
//PlotShapes(wb*shapeSmallCircle, colorYellow, 0, H, 12);
//PlotShapes(wb*shapeSmallCircle, colorYellow, 0, L, -12);

SetBarFillColor( IIf( wb, colorYellow, colorBlack) ); 
Plot( C, "Price", colorBlack, styleCandle );
 
Last edited:
#89
Hi Friends

here is the hawkeye volume chart NIFTY FUTURES JAN2014-afl courtesy mastermind007.


Reading the volume histo bars is rather difficult.
There must be a simpler way of organising the random volume histo bars.

To see the relative domination of up-down-sideways trends of volumes, i took MA(Volumeup,10), etc and plotted.
seems to be a bit better.

here is my pic. SMA 10 of each volume is plotted.
please comment.

=============================================
On thing I think of is is there a way to rationalise the very high very low,medium volume histogram bars HEIGHTS to to more pleasing harmonious look?

Trying to rethink of hawkeye heatmap afl.seems difficult and over my head.
If not seen already,I request mastermind007 to kindly take a look at the heatmap afl i posted earler on this same zone.

something is amiss.
Later comes hwkeye fatboy thing. just a two tf trend plot.
thanks
regards
ford
 
Last edited:

Similar threads