I am trying to use William's Fractal system and found several code on the internet.
I try to compile those code together like this:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("BW Alligator");
/*** The trend indicators ***/
P= ParamList("Price", "Close|(H+L)/2|(H+C+L)/3",1);
if (P=="Close")
A = C;
else
if (P=="(H+C+L)/3")
A = (H+C+L)/3;
else
A = (H+L)/2;
AlligatorJaw = Ref(Wilders(A,13),-8);
AlligatorTeeth = Ref(Wilders(A,8), -5);
AlligatorLips = Ref(Wilders(A,5), -3);
Plot(AlligatorJaw, "Jaw", ParamColor("Jaw's Color",colorBlue), ParamStyle("Jaw's Style", styleThick));
Plot(AlligatorTeeth,"Teeth", ParamColor("Teeth's Color",colorRed), ParamStyle("Teeth's Style", styleThick));
Plot(AlligatorLips, "Lips", ParamColor("Lips's Color",colorGreen), ParamStyle("Lips's Style", styleThick));
_SECTION_END();
_SECTION_BEGIN("BW Fractal");
UpFractal= ValueWhen(
(Ref(H,-2) > Ref(H, -4)) AND
(Ref(H,-2) > Ref(H, -3)) AND
(Ref(H,-2) > Ref(H, -1)) AND
(Ref(H,-2) > H), Ref(H,-2));
DownFractal= ValueWhen(
(Ref(L,-2) <= Ref(L, -4)) AND
(Ref(L,-2) <= Ref(L, -3)) AND
(Ref(L,-2) <= Ref(L, -1)) AND
(Ref(L,-2) <= L), Ref(L,-2));
//== Added Crash crashandburn59 [at] hotmail.com solution
Plot(Ref(UpFractal,2), "Up Fractal", ParamColor("Up Fractal Color",colorRed), ParamStyle("Up Fractal Style", styleDashed));
Plot(Ref(DownFractal,2), "Down Fractal",ParamColor("Down Fractal Color",colorBlue), ParamStyle("Down Fractal Style", styleDashed));
//Plot(Max(HHV(H,3),Ref(UpFractal,2)), "Up Fractal", ParamColor("Up Fractal Color",colorRed), ParamStyle("Up Fractal Style", styleDashed));
//Plot(Max(HHV(H,3),Ref(UpFractal,2)), "Down Fractal",ParamColor("Down Fractal Color",colorBlue), ParamStyle("Down Fractal Style", styleDashed));
_SECTION_END();
_SECTION_BEGIN("AO and AC");
// AO dan AC
AOFast = MA( A, 5 );
AOSlow = MA( A, 34 );
AO = AOFast - AOSlow;
AC = AO - MA( AO, 5 );
AOUB = AO > Ref( AO, -1 );
AODB = AO < Ref( AO, -1 );
ACUB = AC > Ref( AC, -1 );
ACDB = AC < Ref( AC, -1 );
GrnBar = AOUB AND ACUB;
RedBar = AODB AND ACDB;
// WiseMan
WM1L = L < Ref( L, -1 ) AND C > ( ( H + L ) / 2 ) AND AODB AND AO < 0 AND ( O < Ref( AlligatorTeeth, -5 ) AND C < Ref( AlligatorTeeth, -5 ) ) AND ( L < Ref( AlligatorTeeth, -5 ) AND H < Ref( AlligatorTeeth, -5 ) );
WM1S = H > Ref( H, -1 ) AND C < ( ( H + L ) / 2 ) AND AOUB AND AO > 0 AND ( O > Ref( AlligatorTeeth, -5 ) AND C > Ref( AlligatorTeeth, -5 ) ) AND ( L > Ref( AlligatorTeeth, -5 ) AND H > Ref( AlligatorTeeth, -5 ) );
WM2L = Ref( AODB, -3 ) AND Ref( AOUB, -2 ) AND Ref( AOUB, -1 ) AND AOUB;
WM2S = Ref( AOUB, -3 ) AND Ref( AODB, -2 ) AND Ref( AODB, -1 ) AND AODB;
WM3L = Cross( C, UpFractal );
WM3S = Cross( DownFractal, C );
//PlotShapes( IIf( WM2L AND WM3L, shapeDigit4, IIf( WM1L, shapeDigit1, IIf( WM2L, shapeDigit2, IIf( WM3L, shapeDigit3, 0 ) ) ), colorGreen, 0, L, -10 );
PlotShapes( IIf( WM1L, shapeDigit1, IIf( WM2L, shapeDigit2, IIf( WM3L, shapeDigit3, 0 ) ) ), colorGreen, 0, L, -10 );
//PlotShapes( IIf( WM1S, shapeDigit1, 0 ) , colorRed, 0, H, 10 );
PlotShapes( IIf( WM1S, shapeDigit1, IIf( WM2S, shapeDigit2, IIf( WM3S, shapeDigit3, 0 ) ) ), colorRed, 0, H, 10 );
Buy = (WM3L) AND (AlligatorTeeth > AlligatorJaw) AND (AlligatorLips>AlligatorTeeth) AND (C>Ref(O,-1));
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorWhite,1,L*0.96);
_SECTION_END();
The code works fine to draw white arrow shape for my buy signal on intraday timeframe.
However, it is not working on Daily and higher timeframe.
Can anyone help me?