input int AC_1 = 5;//均线一时间周期
input int AC_2 = 10;//均线二时间周期
input ENUM_TIMEFRAMES Period_c = PERIOD_H4;//依据图表周期
input ENUM_TIMEFRAMES Period_d = PERIOD_M15;//交易图表周期
input double ptxs = 100;//ea盈利全平金额
input double slxs = 2000;//ea亏损全平金额
input int Buyn = 20;//多单最大持仓单数
input int Selln = 20;//空单最大持仓单数
input bool closetk = true;//条件反转止损反向单开关
input int Activate_pt = 200; //激活移动止损需要的盈利点数
input int BackClose_pt = 150;//回调平仓点数
input int magic_x = 11336688;//订单识别码
input bool atoks = false;//均线交叉报警开关
int slippage = 30;
bool chenggong = FALSE;
datetime ate=0;
//===============================================================================================================================================
void OnTick()
{
bool Buyoks =false,Selloks=false,Closebuy=false,Closesell=false;
double aca_0 = iAC(Symbol(),Period_c, AC_1, 0, MODE_Ac, PRICE_CLOSE, 0);
double aca_1 = iAC(Symbol(),Period_c, AC_1, 0, MODE_Ac, PRICE_CLOSE, 1);
double aca_2 = iAC(Symbol(),Period_c, AC_1, 0, MODE_Ac, PRICE_CLOSE, 2);
double aca_3 = iAC(Symbol(),Period_c, AC_1, 0, MODE_Ac, PRICE_CLOSE, 3);
double acb_0 = iAC(Symbol(),Period_d, AC_2, 0, MODE_Ac, PRICE_CLOSE, 0);
double acb_1 = iAC(Symbol(),Period_d, AC_2, 0, MODE_Ac, PRICE_CLOSE, 1);
double acb_2 = iAC(Symbol(),Period_d, AC_2, 0, MODE_Ac, PRICE_CLOSE, 2);
double acb_3 = iAC(Symbol(),Period_d, AC_2, 0, MODE_Ac, PRICE_CLOSE, 3);
|