//+------------------------------------------------------------------+
//| rsi -------- qqe v01 .mq4 |
//| liu song |
//+------------------------------------------------------------------+
#property copyright "liu song"
#property link "liu****gwh@qq.com qq:56*****90"
extern double a = 1.2;
extern double b = 43.2365;
extern double c = 50.2589;
extern double lots = 0.1;
extern double slippage=3.0;
extern double diancha=10.0;
extern double kuisun=100.0;
extern int maxlots =1;
extern int sl = 2000;
extern int duan_sl=20;
extern int tp = 20000;
extern string mt4levelstopreversevb0设置 =" mt4-levelstop-reverse-vb0设置";
extern bool useatrmode = true;
extern int nonatrstoppips =1800;
extern int atrperiod = 9;
extern double atrmultiplier = 2.0;
extern int atrsmoothing = 0;
extern color uparrowcolor = dodgerblue;
extern color dnarrowcolor = orangered;
extern int arrowdistance = 0;
int start()
{
//----
double qqe_0,qqe_1,qqe_2,qqe_3,qqe_5,qqe_6,qqe_7,qqe_day_1,qqe_day_2;
double sell,buy,i,guadan,lirun;
double mt4_stop_1,mt4_stop_2,chazhi,chazhi_1;
qqe_day_1 = icustom (symbol(), period_d1, "###qqe_alert_mtf_v3###", 0, 0);
qqe_day_2 = icustom (symbol(), period_d1, "###qqe_alert_mtf_v3###", 1, 0);
qqe_0 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 0);
qqe_1 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 1);
qqe_2 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 2);
qqe_3 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 3);
qqe_5 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 5);
qqe_6 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 6);
qqe_7 = icustom (symbol(), null, "###qqe_alert_mtf_v3###", 0, 7);
mt4_stop_1 = icustom(null,0,"mt4-levelstop-reverse-vb0-3",
useatrmode,nonatrstoppips,atrperiod,atrmultiplier,atrsmoothing,uparrowcolor,dnarrowcolor,arrowdistance,0,1);
mt4_stop_2 = icustom(null,0,"mt4-levelstop-reverse-vb0-3",
useatrmode,nonatrstoppips,atrperiod,atrmultiplier,atrsmoothing,uparrowcolor,dnarrowcolor,arrowdistance,0,2);
chazhi=mt4_stop_1-mt4_stop_2;
if(chazhi>0){
chazhi_1=chazhi;
}
else{
if(chazhi<0){
chazhi_1= 0 -chazhi;
}
}
int total = orderstotal();
if (orderstotal( ) > 0 ){
for(i=orderstotal()-1;i>=0;i--){
if(orderselect(i,select_by_pos,mode_trades)==false) break;
if(ordertype()==op_selllimit){
if(((qqe_6-qqe_5)>a) && qqe_6>c && qqe_7<=qqe_6&&
((qqe_2-qqe_1)>a) && qqe_2>c && qqe_3<=qqe_2 ){
sell= normalizedouble((high[2]+close[2])/2, digits);
ordermodify(orderticket(),sell,sell+sl*point,sell-tp*point,0,blue);
}
else{
if (((qqe_6-qqe_5)>a) && qqe_6>c&& qqe_7<=qqe_6){
orderdelete(orderticket(),blue);
}
}
}
if(ordertype()==op_sell){
comment("账户利润", doubletostr(orderprofit(), 2));
lirun = orderprofit();
if(chazhi_1>0){
ordermodify(orderticket(),orderopenprice(),mt4_stop_1,0,0,blue);
}
/* if(((qqe_1-qqe_2)>a)){
buy= normalizedouble((low[2]+close[2])/2, digits);
ordermodify(orderticket(),orderopenprice(),0,buy+diancha*point,0,blue);
}*/
if(0-lirun>=sl/10){
orderclose(orderticket(),orderlots(),ask,slippage*point,white);
sleep(5000);
}
}
}
}
if (orderstotal( ) > 0 ){
for(i=orderstotal()-1;i>=0;i--){
if(orderselect(i,select_by_pos,mode_trades)==false) break;
if(ordertype()==op_buylimit)
{
if(((qqe_5-qqe_6)>a) && qqe_6<b && qqe_7>=qqe_6&&
((qqe_1-qqe_2)>a) && qqe_2<b && qqe_3>=qqe_2){
buy= normalizedouble((low[2]+close[2])/2, digits);
ordermodify(orderticket(),buy,buy-sl*point,buy+tp*point,0,blue);
}
else{
if (((qqe_5-qqe_6)>a) && qqe_6<b && qqe_7>=qqe_6){
orderdelete(orderticket(),blue);
}
}
}
if(ordertype()==op_buy){
lirun = orderprofit();
comment("账户利润", doubletostr(orderprofit(), 2));
if(chazhi_1>0){
ordermodify(orderticket(),orderopenprice(),mt4_stop_1,0,0,blue);
}
/* if(((qqe_2-qqe_1)>a)){
sell= normalizedouble((high[2]+close[2])/2, digits);
ordermodify(orderticket(),orderopenprice(),0,sell-diancha*point,0,blue);
} */
if(0-lirun>=sl/10){
orderclose(orderticket(),orderlots(),bid,slippage*point,white);
sleep(5000);
}
}
}
}
sell= normalizedouble((high[2]+close[2])/2, digits);
if (total<maxlots && qqe_day_1< qqe_day_2 && ((qqe_2-qqe_1)>a) && qqe_2>c && qqe_3<=qqe_2){
ordersend(symbol(),op_selllimit,lots,sell,slippage*point,sell+sl*point,sell-tp*point,"sell",12345,0,green);
}
buy= normalizedouble((low[2]+close[2])/2, digits);
if (total<maxlots && qqe_day_1> qqe_day_2 && ((qqe_1-qqe_2)>a) && qqe_2<b && qqe_3>=qqe_2){
ordersend(symbol(),op_buylimit,lots,buy,slippage*point,buy-sl*point,buy+tp*point,"buy",12345,0,red);
}
//----
return(0);
}
//+------------------------------------------------------------------+
商品
上一指标公式:蝴蝶指标.ex4 其他指标ex4
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文根据自己的策略改成的ea[MT4] 其他公式改成仅供学习研究。