编码帮助 - 页 394 1...387388389390391392393394395396397398399400401...786 新评论 learning 2014.11.15 21:16 #3931 mladen 有什么建议可以让我们使用MicrosoftVisual Studio 的最有效的dll? pking25 2014.11.16 00:23 #3932 Jeeves: 如果我要求有一个WAV的声音提示,但只在五个人都 "在一条线上 "的情况下才有,那我是不是太不走运了?用户对声音输入的选择 我想我得到了我应得的答复....,我在这个游戏中呆了很久,知道得更多。 我所要做的就是把我的Wav.文件放在>选项>警报框中,然后就完成了工作。 对不起,Mladen,我太笨了,是你让我想到了这个问题。 Mladen Rakic 2014.11.16 18:38 #3933 Jeeves: 我想我得到了我应得的答复....,我在这个游戏中呆了很久,知道得更多。 我所要做的就是把我的Wav.文件放在>选项>警报框中,然后就完成了工作。 对不起,Mladen,我太笨了,是你让我想出了这个办法。 不要担心 周末不是严肃的头脑风暴的时候 mr-roma 2014.11.16 22:09 #3934 大家好,我需要一些帮助,如果有人可以的话,请帮助我。 所以,我想检查 我的总订单,并把它们的背景染成奇数和偶数。 像这样 但我的问题是最后一个标签 :/ 在这张图片中,我的总订单是5个,但标签是6个 :/ 这是我的代码。 int ticket1 = OrdersTotal(); int a_ticket1[]; ArrayResize( a_ticket1, ticket1 ); for (int cnt1=0;cnt1<ticket1;cnt1++) { if ( !OrderSelect(cnt1,SELECT_BY_POS,MODE_TRADES) ) continue; a_ticket1[cnt1]=OrderTicket(); int orcol; if(ExtLines<0) { for(orcol=0; orcol<9; orcol++) { string OrderNumber1 = "Orders Background " +cnt1/2+orcol; string OrderNumbert1 = "Orders Backgrnds " +cnt1/2+orcol; if(ObjectCreate(OrderNumber1,OBJ_LABEL,0,0,0)) { string Ydistanc1 = 65 + (24 * cnt1); ObjectSetText(OrderNumber1, Obg[orcol], 15, "Acc_info", Gray); ObjectSet(OrderNumber1, OBJPROP_CORNER, 0); ObjectSet(OrderNumber1, OBJPROP_XDISTANCE, Obgs[orcol]); ObjectSet(OrderNumber1, OBJPROP_YDISTANCE, Ydistanc1); } if(ObjectCreate(OrderNumbert1,OBJ_LABEL,0,0,0)) { string Ydistanct1 = 89 + (24 * cnt1); ObjectSetText(OrderNumbert1, Obg[orcol], 15, "Acc_info", DarkGray); ObjectSet(OrderNumbert1, OBJPROP_CORNER, 0); ObjectSet(OrderNumbert1, OBJPROP_XDISTANCE, Obgs[orcol]); ObjectSet(OrderNumbert1, OBJPROP_YDISTANCE, Ydistanct1); } } } } 先谢谢你,对不起,我的英语不好 附加的文件: capturedfdsgfd.png 12 kb Coding help 如何编码? 问吧! secretcode 2014.11.17 04:46 #3935 亲爱的编码员 需要您的帮助 附件中的指标运行良好,但如果水平设置为 "0和100",其上的颜色(中心线)就不会变化 是否有可能让它在这些级别上也能工作!? 谢谢你的帮助 秘密代码 附加的文件: rsx_nrp_v1_alerts_mtf_nmc.mq4 11 kb Mladen Rakic 2014.11.17 07:38 #3936 secretcode: 亲爱的编码员需要您的帮助 附件中的指标工作得很好,但如果水平线被设置为 "0和100",其上的颜色(中心线)就不会改变!这是为什么? 是否有可能让它在这些级别上也能工作!? 谢谢你的帮助 秘密代码 秘密代码 RSX的值必须大于或小于水平值。试着用99.9999和0.0001代替100和0。 secretcode 2014.11.17 07:46 #3937 mladen: secretcode RSX的值必须大于或小于水平值。尝试用99.9999和0.0001代替100和0 非常感谢Mladen的帮助 最好的问候。 secretcode [删除] 2014.11.18 02:47 #3938 嗨,姆拉登先生,你好吗?你能帮助我吗? 我正在开发自己的基于支撑和阻力突破的指标。 我已经准备得差不多了,但有32个地方我不知道该在哪里插入代码或写得更好。 1.- 第一件事是让卖出后的第一笔买入涂成另一种颜色,在这种情况下是石灰色,而买入后的第一笔卖出涂成红色。 2.- 要使指标部署一个弹出窗口,用不同的颜色为这个订单写上 "pair .... going long "和 "pair .... going short"。 3.- 将这些分形指标 的代码纳入我的代码中,让所有的东西都粘在一起...... 这是我到现在为止所拥有的指标。 #property strict #属性 indicator_chart_window #属性 indicator_buffers 4 #属性 indicator_color1 clrLime #属性 indicator_color2 clrRed #属性 indicator_color3 clrMagenta #属性 indicator_color4 clrCyan #define BUY 1 #define SELL 2 双重Buy[]。 卖出[]。 FirstBuy[], FirstSell[]。 int OnInit() { SetIndexBuffer(0,FirstBuy); SetIndexBuffer(1,FirstSell); SetIndexBuffer(2,Buy); SetIndexBuffer(3,Sell)。 for(int i=0; i<4; i++) { SetIndexStyle (i,DRAW_ARROW,STYLE_SOLID,2); } SetIndexArrow (0,233); SetIndexArrow (1,234); SetIndexArrow (2,233); SetIndexArrow (3,234)。 返回(INIT_SUCCEEDED);} void OnDeinit(const int reason){}。 int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { static int lastSignal=0; for(int i=MathMin(rate_total-prev_calculated, rates_total-1); i>=0; i--){ FirstBuy=FirstSell=Buy=Sell=EMPTY_VALUE。 datetime when=Time; int x=iBarShift(NULL,PERIOD_H1, when), y=iBarShift(NULL,PERIOD_M15,when), z=iBarShift(NULL,PERIOD_M5, when)。 double srUpH1 = iCustom(NULL,PERIOD_H1, "Support and Resistance (Barry)",0,x), srDownH1 = iCustom(NULL,PERIOD_H1, "支持和阻力(巴里)",1,x)。 MidH1 = (srUpH1+srDownH1)/2, srUp15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",0,y)。 srDown15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",1,y)。 Mid15M = (srUp15M+srDown15M)/2, srUp5M = iCustom(NULL,PERIOD_M5, "Support and Resistance (Barry)",0,z)。 srDown5M = iCustom(NULL,PERIOD_M5, "支持和阻力(巴里)",1,z)。 Mid5M = (srUp5M+srDown5M)/2, srUp = iCustom(NULL,0, "Support and Resistance (Barry)",0,i)。 srDown = iCustom(NULL,0, "Support and Resistance (Barry)",1,i)。 如果(ClosesrUp){ if(lastSignal==SELL) { FirstBuy=Low-_Point; SoundAlert(when, "Buy"); } 否则 { Buy=Low-_Point; } lastSignal=BUY;} 如果(Close>srUpH1 && Close<srDown) { 如果(lastSignal==BUY) { FirstSell=High+_Point; SoundAlert(when, "Sell"); } 否则 { Sell=High+_Point; } lastSignal=SELL;}} return(rate_total);} void SoundAlert(datetime i, string dir) { static datetime lastAlert=0。 如果(lastAlert!=i) { Alert(StringFormat("%s signal on %s at %s",dir,Symbol(),TimeToStr(i))。 lastAlert=i;}} 这是支撑位和阻力位的分形图代码,我不知道该在哪里输入。 #property indicator_chart_window#property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Blue //---- buffers double v1[]; double v2[]; double val1; double val2; int i。 int init() { IndicatorBuffers(2); //---- 绘图设置 SetIndexArrow(0, 119); SetIndexArrow(1, 119); SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red); SetIndexDrawBegin(0, i-1); SetIndexBuffer(0, v1); SetIndexLabel(0, "阻力"); SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue); SetIndexDrawBegin(1,i-1); SetIndexBuffer(1, v2); SetIndexLabel(1, "支持"); return(0); } int start() { i=Bars; while(i>=0) { val1 = iFractals(NULL, 0, MODE_UPPER,i); if (val1 > 0) v1=High; else v1 = v1; val2 = iFractals(NULL, 0, MODE_LOWER,i); if (val2 > 0) v2 = Low; else v2 = v2; i--; } return(0); } //+------------------------------------------------------------------+ [/TD] [/TR] [TR] [TD="class: bb-bot, width: 100%"] [TD="class: bb-right-bot, width: 4"]谢谢 Coding help [警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 Metastock to MT4 Mladen Rakic 2014.11.18 06:23 #3939 daniel1983: 嗨,Mladen先生,你好吗?你能帮助我吗? 我正在开发自己的基于支撑和阻力突破的指标。我已经基本准备好了,但有32个地方我不知道该在哪里插入代码或写得更好。1.- 第一件事是让卖出后的第一笔买入涂成另一种颜色,在这种情况下是石灰色,而买入后的第一笔卖出涂成红色。2.- 要使指标部署一个弹出窗口,用不同的颜色为这个订单写上 "pair .... going long "和 "pair .... going short"。3.- 将这些分形指标的代码纳入我的代码中,让所有的东西都粘在一起......这是我到现在为止所拥有的指标。#property strict#属性 indicator_chart_window#属性 indicator_buffers 4#属性 indicator_color1 clrLime#属性 indicator_color2 clrRed#属性 indicator_color3 clrMagenta#属性 indicator_color4 clrCyan#define BUY 1#define SELL 2双重Buy[]。 卖出[]。 FirstBuy[], FirstSell[]。int OnInit() { SetIndexBuffer(0,FirstBuy); SetIndexBuffer(1,FirstSell); SetIndexBuffer(2,Buy); SetIndexBuffer(3,Sell)。 for(int i=0; i<4; i++) { SetIndexStyle (i,DRAW_ARROW,STYLE_SOLID,2); } SetIndexArrow (0,233); SetIndexArrow (1,234); SetIndexArrow (2,233); SetIndexArrow (3,234)。 返回(INIT_SUCCEEDED);}void OnDeinit(const int reason){}。int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { static int lastSignal=0; for(int i=MathMin(rate_total-prev_calculated, rates_total-1); i>=0; i--){ FirstBuy=FirstSell=Buy=Sell=EMPTY_VALUE。 datetime when=Time; int x=iBarShift(NULL,PERIOD_H1, when), y=iBarShift(NULL,PERIOD_M15,when), z=iBarShift(NULL,PERIOD_M5, when)。 double srUpH1 = iCustom(NULL,PERIOD_H1, "Support and Resistance (Barry)",0,x), srDownH1 = iCustom(NULL,PERIOD_H1, "支持和阻力(巴里)",1,x)。 MidH1 = (srUpH1+srDownH1)/2, srUp15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",0,y)。 srDown15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",1,y)。 Mid15M = (srUp15M+srDown15M)/2, srUp5M = iCustom(NULL,PERIOD_M5, "Support and Resistance (Barry)",0,z)。 srDown5M = iCustom(NULL,PERIOD_M5, "支持和阻力(巴里)",1,z)。 Mid5M = (srUp5M+srDown5M)/2, srUp = iCustom(NULL,0, "Support and Resistance (Barry)",0,i)。 srDown = iCustom(NULL,0, "Support and Resistance (Barry)",1,i)。 如果(ClosesrUp){ if(lastSignal==SELL) { FirstBuy=Low-_Point; SoundAlert(when, "Buy"); } 否则 { Buy=Low-_Point; } lastSignal=BUY;} 如果(Close>srUpH1 && Close<srDown) { 如果(lastSignal==BUY) { FirstSell=High+_Point; SoundAlert(when, "Sell"); } 否则 { Sell=High+_Point; } lastSignal=SELL;}} return(rate_total);} void SoundAlert(datetime i, string dir) { static datetime lastAlert=0。 如果(lastAlert!=i) { Alert(StringFormat("%s signal on %s at %s",dir,Symbol(),TimeToStr(i))。 lastAlert=i;}}这是支撑位和阻力位的分形图代码,我不知道该在哪里输入。 #property indicator_chart_window#property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 Blue //---- buffers double v1[]; double v2[]; double val1; double val2; int i。 int init() { IndicatorBuffers(2); //---- 绘图设置 SetIndexArrow(0, 119); SetIndexArrow(1, 119); SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red); SetIndexDrawBegin(0, i-1); SetIndexBuffer(0, v1); SetIndexLabel(0, "阻力"); SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue); SetIndexDrawBegin(1,i-1); SetIndexBuffer(1, v2); SetIndexLabel(1, "支持"); return(0); } int start() { i=Bars; while(i>=0) { val1 = iFractals(NULL, 0, MODE_UPPER,i); if (val1 > 0) v1=High; else v1 = v1; val2 = iFractals(NULL, 0, MODE_LOWER,i); if (val2 > 0) v2 = Low; else v2 = v2; i--; } return(0); } //+------------------------------------------------------------------+ [/TD] [/TR] [TR] [TD="class: bb-bot, width: 100%"] [TD="class: bb-right-bot, width: 4"]谢谢 daniel1983 现在是第2和第3点。 2.简单地添加Alert(t "text to use for popup window"),就可以有一个弹出式警报。 3.这不是一个好主意--使代码过于复杂,增加了工作出错的可能性 secretcode 2014.11.18 06:25 #3940 亲爱的Mladen 是否可以在附件中的指标中 "添加波段",就像在这个帖子中:https://www.mql5.com/en/forum/172894/page45 该指标来自精英部分,但我喜欢你在上面添加波段的方式。 谢谢你的帮助 秘密代码 附加的文件: ema_variation__filter_mtf_1.01_nmc.mq4 9 kb 1...387388389390391392393394395396397398399400401...786 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
mladen
有什么建议可以让我们使用MicrosoftVisual Studio 的最有效的dll?
如果我要求有一个WAV的声音提示,但只在五个人都 "在一条线上 "的情况下才有,那我是不是太不走运了?用户对声音输入的选择
我想我得到了我应得的答复....,我在这个游戏中呆了很久,知道得更多。
我所要做的就是把我的Wav.文件放在>选项>警报框中,然后就完成了工作。 对不起,Mladen,我太笨了,是你让我想到了这个问题。
我想我得到了我应得的答复....,我在这个游戏中呆了很久,知道得更多。 我所要做的就是把我的Wav.文件放在>选项>警报框中,然后就完成了工作。 对不起,Mladen,我太笨了,是你让我想出了这个办法。
不要担心
周末不是严肃的头脑风暴的时候
大家好,我需要一些帮助,如果有人可以的话,请帮助我。
所以,我想检查 我的总订单,并把它们的背景染成奇数和偶数。
像这样
但我的问题是最后一个标签 :/ 在这张图片中,我的总订单是5个,但标签是6个 :/
这是我的代码。
int ticket1 = OrdersTotal();
int a_ticket1[];
ArrayResize( a_ticket1, ticket1 );
for (int cnt1=0;cnt1<ticket1;cnt1++)
{
if ( !OrderSelect(cnt1,SELECT_BY_POS,MODE_TRADES) ) continue;
a_ticket1[cnt1]=OrderTicket();
int orcol;
if(ExtLines<0)
{
for(orcol=0; orcol<9; orcol++)
{
string OrderNumber1 = "Orders Background " +cnt1/2+orcol;
string OrderNumbert1 = "Orders Backgrnds " +cnt1/2+orcol;
if(ObjectCreate(OrderNumber1,OBJ_LABEL,0,0,0))
{
string Ydistanc1 = 65 + (24 * cnt1);
ObjectSetText(OrderNumber1, Obg[orcol], 15, "Acc_info", Gray);
ObjectSet(OrderNumber1, OBJPROP_CORNER, 0);
ObjectSet(OrderNumber1, OBJPROP_XDISTANCE, Obgs[orcol]);
ObjectSet(OrderNumber1, OBJPROP_YDISTANCE, Ydistanc1);
}
if(ObjectCreate(OrderNumbert1,OBJ_LABEL,0,0,0))
{
string Ydistanct1 = 89 + (24 * cnt1);
ObjectSetText(OrderNumbert1, Obg[orcol], 15, "Acc_info", DarkGray);
ObjectSet(OrderNumbert1, OBJPROP_CORNER, 0);
ObjectSet(OrderNumbert1, OBJPROP_XDISTANCE, Obgs[orcol]);
ObjectSet(OrderNumbert1, OBJPROP_YDISTANCE, Ydistanct1);
}
}
}
}先谢谢你,对不起,我的英语不好
亲爱的编码员
需要您的帮助
附件中的指标运行良好,但如果水平设置为 "0和100",其上的颜色(中心线)就不会变化
是否有可能让它在这些级别上也能工作!?
谢谢你的帮助
秘密代码
亲爱的编码员
需要您的帮助
附件中的指标工作得很好,但如果水平线被设置为 "0和100",其上的颜色(中心线)就不会改变!这是为什么?
是否有可能让它在这些级别上也能工作!?
谢谢你的帮助
秘密代码秘密代码
RSX的值必须大于或小于水平值。试着用99.9999和0.0001代替100和0。
secretcode RSX的值必须大于或小于水平值。尝试用99.9999和0.0001代替100和0
非常感谢Mladen的帮助
最好的问候。
secretcode
嗨,姆拉登先生,你好吗?你能帮助我吗?
我正在开发自己的基于支撑和阻力突破的指标。
我已经准备得差不多了,但有32个地方我不知道该在哪里插入代码或写得更好。
1.- 第一件事是让卖出后的第一笔买入涂成另一种颜色,在这种情况下是石灰色,而买入后的第一笔卖出涂成红色。
2.- 要使指标部署一个弹出窗口,用不同的颜色为这个订单写上 "pair .... going long "和 "pair .... going short"。
3.- 将这些分形指标 的代码纳入我的代码中,让所有的东西都粘在一起......
这是我到现在为止所拥有的指标。
#property strict
#属性 indicator_chart_window
#属性 indicator_buffers 4
#属性 indicator_color1 clrLime
#属性 indicator_color2 clrRed
#属性 indicator_color3 clrMagenta
#属性 indicator_color4 clrCyan
#define BUY 1
#define SELL 2
双重Buy[]。
卖出[]。
FirstBuy[],
FirstSell[]。
int OnInit() {
SetIndexBuffer(0,FirstBuy);
SetIndexBuffer(1,FirstSell);
SetIndexBuffer(2,Buy);
SetIndexBuffer(3,Sell)。
for(int i=0; i<4; i++) {
SetIndexStyle (i,DRAW_ARROW,STYLE_SOLID,2); }
SetIndexArrow (0,233);
SetIndexArrow (1,234);
SetIndexArrow (2,233);
SetIndexArrow (3,234)。
返回(INIT_SUCCEEDED);}
void OnDeinit(const int reason){}。
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[],
const double &open[], const double &high[], const double &low[],
const double &close[], const long &tick_volume[], const long &volume[],
const int &spread[]) {
static int lastSignal=0;
for(int i=MathMin(rate_total-prev_calculated, rates_total-1); i>=0; i--){
FirstBuy=FirstSell=Buy=Sell=EMPTY_VALUE。
datetime when=Time;
int x=iBarShift(NULL,PERIOD_H1, when),
y=iBarShift(NULL,PERIOD_M15,when),
z=iBarShift(NULL,PERIOD_M5, when)。
double srUpH1 = iCustom(NULL,PERIOD_H1, "Support and Resistance (Barry)",0,x),
srDownH1 = iCustom(NULL,PERIOD_H1, "支持和阻力(巴里)",1,x)。
MidH1 = (srUpH1+srDownH1)/2,
srUp15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",0,y)。
srDown15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",1,y)。
Mid15M = (srUp15M+srDown15M)/2,
srUp5M = iCustom(NULL,PERIOD_M5, "Support and Resistance (Barry)",0,z)。
srDown5M = iCustom(NULL,PERIOD_M5, "支持和阻力(巴里)",1,z)。
Mid5M = (srUp5M+srDown5M)/2,
srUp = iCustom(NULL,0, "Support and Resistance (Barry)",0,i)。
srDown = iCustom(NULL,0, "Support and Resistance (Barry)",1,i)。
如果(ClosesrUp){
if(lastSignal==SELL) {
FirstBuy=Low-_Point;
SoundAlert(when, "Buy"); }
否则 {
Buy=Low-_Point; }
lastSignal=BUY;}
如果(Close>srUpH1 && Close<srDown) {
如果(lastSignal==BUY) {
FirstSell=High+_Point;
SoundAlert(when, "Sell"); }
否则 {
Sell=High+_Point; }
lastSignal=SELL;}}
return(rate_total);}
void SoundAlert(datetime i, string dir) {
static datetime lastAlert=0。
如果(lastAlert!=i) {
Alert(StringFormat("%s signal on %s at %s",dir,Symbol(),TimeToStr(i))。
lastAlert=i;}}
这是支撑位和阻力位的分形图代码,我不知道该在哪里输入。
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i。
int init()
{
IndicatorBuffers(2);
//---- 绘图设置
SetIndexArrow(0, 119);
SetIndexArrow(1, 119);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(0, i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "阻力");
SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexDrawBegin(1,i-1);
SetIndexBuffer(1, v2);
SetIndexLabel(1, "支持");
return(0);
}
int start()
{
i=Bars;
while(i>=0)
{
val1 = iFractals(NULL, 0, MODE_UPPER,i);
if (val1 > 0)
v1=High;
else
v1 = v1;
val2 = iFractals(NULL, 0, MODE_LOWER,i);
if (val2 > 0)
v2 = Low;
else
v2 = v2;
i--;
}
return(0);
}
//+------------------------------------------------------------------+
[/TD] [/TR
] [TR]
嗨,Mladen先生,你好吗?你能帮助我吗?
我正在开发自己的基于支撑和阻力突破的指标。
我已经基本准备好了,但有32个地方我不知道该在哪里插入代码或写得更好。
1.- 第一件事是让卖出后的第一笔买入涂成另一种颜色,在这种情况下是石灰色,而买入后的第一笔卖出涂成红色。
2.- 要使指标部署一个弹出窗口,用不同的颜色为这个订单写上 "pair .... going long "和 "pair .... going short"。
3.- 将这些分形指标的代码纳入我的代码中,让所有的东西都粘在一起......
这是我到现在为止所拥有的指标。
#property strict
#属性 indicator_chart_window
#属性 indicator_buffers 4
#属性 indicator_color1 clrLime
#属性 indicator_color2 clrRed
#属性 indicator_color3 clrMagenta
#属性 indicator_color4 clrCyan
#define BUY 1
#define SELL 2
双重Buy[]。
卖出[]。
FirstBuy[],
FirstSell[]。
int OnInit() {
SetIndexBuffer(0,FirstBuy);
SetIndexBuffer(1,FirstSell);
SetIndexBuffer(2,Buy);
SetIndexBuffer(3,Sell)。
for(int i=0; i<4; i++) {
SetIndexStyle (i,DRAW_ARROW,STYLE_SOLID,2); }
SetIndexArrow (0,233);
SetIndexArrow (1,234);
SetIndexArrow (2,233);
SetIndexArrow (3,234)。
返回(INIT_SUCCEEDED);}
void OnDeinit(const int reason){}。
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[],
const double &open[], const double &high[], const double &low[],
const double &close[], const long &tick_volume[], const long &volume[],
const int &spread[]) {
static int lastSignal=0;
for(int i=MathMin(rate_total-prev_calculated, rates_total-1); i>=0; i--){
FirstBuy=FirstSell=Buy=Sell=EMPTY_VALUE。
datetime when=Time;
int x=iBarShift(NULL,PERIOD_H1, when),
y=iBarShift(NULL,PERIOD_M15,when),
z=iBarShift(NULL,PERIOD_M5, when)。
double srUpH1 = iCustom(NULL,PERIOD_H1, "Support and Resistance (Barry)",0,x),
srDownH1 = iCustom(NULL,PERIOD_H1, "支持和阻力(巴里)",1,x)。
MidH1 = (srUpH1+srDownH1)/2,
srUp15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",0,y)。
srDown15M = iCustom(NULL,PERIOD_M15, "Support and Resistance (Barry)",1,y)。
Mid15M = (srUp15M+srDown15M)/2,
srUp5M = iCustom(NULL,PERIOD_M5, "Support and Resistance (Barry)",0,z)。
srDown5M = iCustom(NULL,PERIOD_M5, "支持和阻力(巴里)",1,z)。
Mid5M = (srUp5M+srDown5M)/2,
srUp = iCustom(NULL,0, "Support and Resistance (Barry)",0,i)。
srDown = iCustom(NULL,0, "Support and Resistance (Barry)",1,i)。
如果(ClosesrUp){
if(lastSignal==SELL) {
FirstBuy=Low-_Point;
SoundAlert(when, "Buy"); }
否则 {
Buy=Low-_Point; }
lastSignal=BUY;}
如果(Close>srUpH1 && Close<srDown) {
如果(lastSignal==BUY) {
FirstSell=High+_Point;
SoundAlert(when, "Sell"); }
否则 {
Sell=High+_Point; }
lastSignal=SELL;}}
return(rate_total);}
void SoundAlert(datetime i, string dir) {
static datetime lastAlert=0。
如果(lastAlert!=i) {
Alert(StringFormat("%s signal on %s at %s",dir,Symbol(),TimeToStr(i))。
lastAlert=i;}}
这是支撑位和阻力位的分形图代码,我不知道该在哪里输入。
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i。
int init()
{
IndicatorBuffers(2);
//---- 绘图设置
SetIndexArrow(0, 119);
SetIndexArrow(1, 119);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(0, i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "阻力");
SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexDrawBegin(1,i-1);
SetIndexBuffer(1, v2);
SetIndexLabel(1, "支持");
return(0);
}
int start()
{
i=Bars;
while(i>=0)
{
val1 = iFractals(NULL, 0, MODE_UPPER,i);
if (val1 > 0)
v1=High;
else
v1 = v1;
val2 = iFractals(NULL, 0, MODE_LOWER,i);
if (val2 > 0)
v2 = Low;
else
v2 = v2;
i--;
}
return(0);
}
//+------------------------------------------------------------------+
[/TD] [/TR
] [TR]
daniel1983
现在是第2和第3点。
2.简单地添加Alert(t "text to use for popup window"),就可以有一个弹出式警报。
3.这不是一个好主意--使代码过于复杂,增加了工作出错的可能性
亲爱的Mladen
是否可以在附件中的指标中 "添加波段",就像在这个帖子中:https://www.mql5.com/en/forum/172894/page45
该指标来自精英部分,但我喜欢你在上面添加波段的方式。
谢谢你的帮助
秘密代码