//http://www.wisestocktrader.com/indicators/3838-trendtradingbp-4hourly
//trendtrading bp h4 timeframe
//coder:courtesy:RameshVelidi, email:[email protected]
//gmma BASED simple Code USES HULL MOVING AVERAGE 5 AND 12
//AIMS SHORT QUICK TRADES on H4
grid_day = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(grid_day,"",colorOrange,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);
//==========================
SetChartBkColor(64);
SetChartOptions(0, chartShowArrows | chartShowDates);
Plot(C,"close",IIf(Close > Open,colorWhite,colorRed),styleCandle);
FastMAColor = ParamColor("Fast Group MA Color", colorGreen);
SlowMAColor = ParamColor("Slow Group MA Color", colorRed);
EMA20=EMA(C,20); EMA30 =EMA(C,30);
Plot(EMA(C, 20), "", colorCustom12, styleThick);
Plot(EMA(C, 30), " ", colorYellow, styleThick);
Plot(EMA(C, 35), " ", SlowMAColor, styleLine);
Plot(EMA(C, 40), " ", SlowMAColor, styleLine);
Plot(EMA(C, 45), " ", SlowMAColor, styleLine);
Plot(EMA(C, 50), " ", SlowMAColor, styleLine);
Plot(EMA(C, 60), " ", SlowMAColor, styleLine);
//==============================================
//HMA5 HULL MOVING AVERAGE
array = Close;
period= 5;
function HMA_AFL( array, period )
{
fast = WMA( array, period / 2 );
slow = WMA( array, period );
return WMA( 2 * fast - slow, sqrt( period ) );
}
Plot(HMA(Close,5),"HMA(C,5)",colorBrightGreen,styleThick);
_SECTION_END();
//=============================================================
HMA12 = HMA(C,12);
E2030COLOR = IIf(EMA20>EMA30,colorDarkGreen,colorDarkRed);
PlotOHLC(EMA20,EMA20,EMA30,EMA30," ",E2030COLOR,styleCloud);
//HMA12 HULL MOVING AVERAGE
array = Close;
period1= 12;
{
fast = WMA( array, period1 / 2 );
slow = WMA( array, period1 );
HMA12 = WMA( 2 * fast - slow, sqrt( period1 ) );
}
Plot(HMA(Close,12),"HMA(C,12)",colorRed,styleThick);
_SECTION_END();
_SECTION_BEGIN("HMA HULL MOVING AVERAGE1");
//note you can use HMA5 & HMA21 also if it suits you.