very profitable, Please Help to find the problem of this AFL exploration and scanner code

#1
Dear Sir, Madam,
I wrote this AFL to find the trading pair in the spot market based on the MA of ADX of Vortex,
The indicator works well and shows visually what I want, but when I do analysis in AMIbroker.
the columns for the data are empty (exploration) and so no buy/sell signal (scanner).
what is the problem? please help

thanks in advance.

_SECTION_BEGIN("MA of ADX of VOrtex");
// v 0.001 2
// MA of ADX of VOrtex
// Developed by Mehdi based on the ADX of Vortex


// ****************************************************************************************
// MAIN CODE
// ****************************************************************************************
period = Param("Period" , 14, 2 );
period2 = Param("Period2" , 3, 2 );

VMP = Sum( abs( H - Ref( L, -1 ) ), period );
VMM = Sum( abs( L - Ref( H, -1 ) ), period );
STR = Sum( ATR( 1 ), period );
VIP = VMP / STR;
VIM = VMM / STR;

DIDif=abs(VIP-VIM)*10;
DISum=(VIP+VIM)*10;
ADXofVortex=100*Wilders(DIDif/DISum,period);
VIPD= VIP*10; // VIP Data
VIMD=VIM*10; //VIM Data
Plot( VIPD, "VI-Plus"+period, colorBlue | styleThick );
Plot( VIMD, "VI-Minus"+period, colorRed );
Plot(ADXofVortex,"ADX of Vortex", colorWhite, styleThick | styleLine);
MAADXV= MA(ADXofVortex, period2); // moving average of ADX of Vortex
Plot (MA(ADXofVortex, period2), "MAADXV", colorYellow, styleThick | styleLine);
Plot(15,"",colorWhite,styleLine);
Plot(10,"",colorWhite,styleDashed);

// END OF "MAIN CODE" SECTION


// ****************************************************************************************
// TRADING SYSTEM ENTRY FORMULAS
// ****************************************************************************************
Buy = Cross(ADXofVortex, MAADXV) AND VIP > VIM;
Short = Cross(MAADXV, ADXofVortex);

// Exploration in Amibroker

Filter = 1;
AddColumn(VIP,"VIP",format=1.4);
AddColumn(VIM, "VIM", format=1.4);
AddColumn(Buy, "Buy", format=1.0);
AddColumn(Short, "Short", format=1.0);
//AddColumn(BuyPrice, "BuyPrice", format=1.2);
//AddColumn(ShortPrice, "ShortPrice", format=1.2);

// END OF "TRADING SYSTEM ENTRY FORMULAS" SECTION


// ****************************************************************************************
// TRADING SYSTEM EXIT FORMULAS
// ****************************************************************************************
Sell = Short;
Cover = Buy;

// Exploration in Amibroker
AddColumn(Sell, "Sell", format=1.0);
AddColumn(Cover, "Cover", format=1.0);
//AddColumn(SellPrice, "SellPrice", format=1.2);
//AddColumn(CoverPrice, "CoverPrice", format=1.2);

// END OF "TRADING SYSTEM EXIT FORMULAS" SECTION


// ****************************************************************************************
// TRADING SYSTEM EXCESSIVE ENTRY/EXIT SIGNALS REMOVING FORMULAS
// ****************************************************************************************
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);

// END OF "TRADING SYSTEM EXCESSIVE ENTRY/EXIT SIGNALS REMOVING FORMULAS" SECTION




// ****************************************************************************************
// END OF CODE (BBFEAR.AFL)
// ****************************************************************************************
/**/
_SECTION_END();
 

Attachments

Similar threads