Please help me modify below afl , there are two buy conditions and two sell conditions,
i want to place buy /sell arrows whenever either condition is fulfilled first and again buy /sell if second condition also fullfilled ,
also i want buy sell signals in Alert Output
buy condition 1 = buy when green line cross red line
buy condition 2 = buy when green line cross yellow line
sell condition 1 = sell when green line cross yellow line
sell condition 2 = sell when green line cross red line
_SECTION_BEGIN("VK SPECIAL");
TRH = IIf(Ref(C, -1) > H, Ref(C, -1), H);
TRL = IIf(Ref(C, -1) < L, Ref(C, -1), L);
ad = IIf(C > Ref(C, -1), C - TRL, IIf(C < Ref(C, -1), C - TRH, 0));
xAD = Cum(ad);
X=nda = Wilders(EMA((xAD-Ref(xAD,-1)),14),7);
Plot(nda, "nda" , colorBrightGreen,4 , styleLine|styleThick);
ndi=0;
Plot(ndi, "ndi" , colorYellow , styleLine|styleThick|styleDots);
_SECTION_BEGIN("TEMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 100, 2, 300, 1, 10 );
B= TEMA( P, Periods );
Plot(b, _DEFAULT_NAME(), ParamColor( "ColorRED", colorRed ), ParamStyle("Style") );
_SECTION_END();
PLEASE HELP & THANKS IN ADVANCE
i want to place buy /sell arrows whenever either condition is fulfilled first and again buy /sell if second condition also fullfilled ,
also i want buy sell signals in Alert Output
buy condition 1 = buy when green line cross red line
buy condition 2 = buy when green line cross yellow line
sell condition 1 = sell when green line cross yellow line
sell condition 2 = sell when green line cross red line
_SECTION_BEGIN("VK SPECIAL");
TRH = IIf(Ref(C, -1) > H, Ref(C, -1), H);
TRL = IIf(Ref(C, -1) < L, Ref(C, -1), L);
ad = IIf(C > Ref(C, -1), C - TRL, IIf(C < Ref(C, -1), C - TRH, 0));
xAD = Cum(ad);
X=nda = Wilders(EMA((xAD-Ref(xAD,-1)),14),7);
Plot(nda, "nda" , colorBrightGreen,4 , styleLine|styleThick);
ndi=0;
Plot(ndi, "ndi" , colorYellow , styleLine|styleThick|styleDots);
_SECTION_BEGIN("TEMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 100, 2, 300, 1, 10 );
B= TEMA( P, Periods );
Plot(b, _DEFAULT_NAME(), ParamColor( "ColorRED", colorRed ), ParamStyle("Style") );
_SECTION_END();
PLEASE HELP & THANKS IN ADVANCE