编码帮助 - 页 667 1...660661662663664665666667668669670671672673674...786 新评论 dotmund 2016.08.12 17:24 #6661 我需要有人帮助我把这个ema交叉点变成一个EA。当蓝色箭头出现时开仓买入,当红色箭头出现时卖出,当箭头旁边的蜡烛关闭时退出交易。 附加的文件: EMA_Cross__SES__BDv8_12_31.ex4 6 kb EMA_Cross__SES__BDv8_12_31.mq4 5 kb Mladen Rakic 2016.08.12 18:45 #6662 dotmund: 我需要有人帮我把这个ema交叉点变成一个EA。当蓝色箭头出现时开仓买入,当红色箭头出现时卖出,当箭头旁边的蜡烛关闭时退出交易,请让SL和TP可以调整,以及MAs。 查看此帖:https://www.mql5.com/en/forum/180648/page940 Entropy 2016.08.13 02:55 #6663 mladen: 对于蜡烛时间,最好使用一些专门的指标(如附件)。至于周期分离器:它已经是nmc,但你可能想使用附件(它应该在CPU上更轻)。 非常感谢你。 我正在尝试 添加 "BarsLimit" 选项,但 我没有 成功。 请你帮助我。 非常感谢您的时间。 附加的文件: Period Separator 2_3_1.mq4 3 kb Mladen Rakic 2016.08.13 08:57 #6664 Entropy: 非常感谢你。 我试图 添加 "BarsLimit" 的选项,但 我没有 成功。 请你帮助我。 非常感谢您的时间。 熵这是一个添加了该选项的版本 附加的文件: Period Separator 2_4.mq4 3 kb FxSteven 2016.08.13 21:39 #6665 你好,mladen,你能教我解决这个问题吗?这是我得到的警告。declaration of 'MinLots' hides global declaration at line 93 declaration of 'MaxLots' hides global declaration at line 94 declaration of 'Magic' hides global declaration at line 118 void CalculateMM() { double MinLots=MarketInfo(Symbol(),MODE_MINLOT); double MaxLots=MarketInfo(Symbol(),MODE_MAXLOT); Lots=AccountFreeMargin()/100000*RiskPercent; Lots=MathMin(MaxLots,MathMax(MinLots,Lots)); if(MinLots<0.1)Lots=NormalizeDouble(Lots,2); else { if(MinLots<1)Lots=NormalizeDouble(Lots,1); else Lots=NormalizeDouble(Lots,0); } if(Lots<MinLots)Lots=MinLots; if(Lots>MaxLots)Lots=MaxLots; return; int CloseBuyOrders(int Magic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) { ClTicket= OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); } int CloseBuyOrdersHiddenTP(int Magic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY&&Bid>(OrderOpenPrice()+TakeProfit*Point)) { ClTicket=OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); }谢谢你。 Mladen Rakic 2016.08.14 06:19 #6666 stevenpun: 你好,mladen,你能教我解决这个问题吗?这就是我得到的警告。谢谢你。 首先是这个。void CalculateMM() { double tMinLots=MarketInfo(Symbol(),MODE_MINLOT); double tMaxLots=MarketInfo(Symbol(),MODE_MAXLOT); Lots=AccountFreeMargin()/100000*RiskPercent; Lots=MathMin(tMaxLots,MathMax(tMinLots,Lots)); if(tMinLots<0.1)Lots=NormalizeDouble(Lots,2); else { if(tMinLots<1)Lots=NormalizeDouble(Lots,1); else Lots=NormalizeDouble(Lots,0); } if(Lots<tMinLots)Lots=tMinLots; if(Lots>tMaxLots)Lots=tMaxLots; return; 和这个int CloseBuyOrders(int tMagic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==tMagic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY) { ClTicket= OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); } int CloseBuyOrdersHiddenTP(int tMagic) { int total=OrdersTotal(); for (int cnt=total-1;cnt>=0;cnt--) { if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) if(OrderMagicNumber()==tMagic&&OrderSymbol()==Symbol()) { if(OrderType()==OP_BUY&&Bid>(OrderOpenPrice()+TakeProfit*Point)) { ClTicket=OrderClose(OrderTicket(),OrderLots(),Bid,3); } } } return(0); } murnathan32 2016.08.15 19:30 #6667 你好,Mladen。您能帮我看看这段代码吗,先生,有什么需要修正的吗?另外,当它进入更高的时间框架时,是否有可能改变从===> 1分钟 ~ 30分钟 ===> 每10点===> 1小时 ======> 每50点===> 4小时,每日 ======> 每100点===> 每周,每月 ===> 每1000点希望用矩形代替线,先生。#property indicator_chart_window#define ONDA_BEGINS 0#define ONDA_CONTAINS 1//+------------------------------------------------------------------+//|自定义指标初始化函数|//+------------------------------------------------------------------+int init(){//---- 指标//----return(0);}//+------------------------------------------------------------------+//|自定义指标去初始化功能|//+------------------------------------------------------------------+int deinit(){//----for (int ix = 0; ix < nLines; ix++) // 删除我的水平线{ObjectDelete("tensLines "+ix)。}//----return(0);}//+------------------------------------------------------------------+//|自定义指标迭代函数|//+------------------------------------------------------------------+int start(){int nLines = 40; // 要画的总线数double lineInterval = 0.0010; // 线段之间的间隔double normPrice = NormalizeDouble(Close[1],3); // 当前价格被四舍五入到最接近的 "10"for (int ix = 0; ix < nLines; ix++) // 循环跨度次数{if(ObjectFind("tensLines "+ix) < 0)ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); //将一半放在当前价格的上方,一半放在下方else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval))。ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 使线条看起来更好。}//----return(0);}//+------------------------------------------------------------------+void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY){for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){string on = ObjectName(iObj);int iPos = StringFind(on, name);如果(iPos < 0)继续。如果(iPos > 0 && where == ONDA_BEGINS)继续。如果(type == EMPTY) ObjectDelete(on);否则如果(type == ObjectType(on))ObjectDelete(on);}}//--- Coding help 任何菜鸟问题,为了不给论坛添乱。专业人士,不要路过。没有你就无处可去 - 6. 支点指标 Mladen Rakic 2016.08.15 20:01 #6668 murnathan32: 你好,Mladen。您能帮我看看这段代码吗,先生,有什么需要修正的吗?另外,当它进入更高的时间框架时,是否有可能改变从===> 1分钟 ~ 30分钟 ===> 每10点===> 1小时 ======> 每50点===> 4小时,每日 ======> 每100点===> 每周,每月 ===> 每1000点希望用矩形代替线,先生。#property indicator_chart_window#define ONDA_BEGINS 0#define ONDA_CONTAINS 1//+------------------------------------------------------------------+//|自定义指标初始化函数|//+------------------------------------------------------------------+int init(){//---- 指标//----return(0);}//+------------------------------------------------------------------+//|自定义指标去初始化功能|//+------------------------------------------------------------------+int deinit(){//----for (int ix = 0; ix < nLines; ix++) // 删除我的水平线{ObjectDelete("tensLines "+ix)。}//----return(0);}//+------------------------------------------------------------------+//|自定义指标迭代函数|//+------------------------------------------------------------------+int start(){int nLines = 40; // 要画的总线数double lineInterval = 0.0010; // 线段之间的间隔double normPrice = NormalizeDouble(Close[1],3); // 当前价格被四舍五入到最接近的 "10"for (int ix = 0; ix < nLines; ix++) // 循环跨度次数{if(ObjectFind("tensLines "+ix) < 0)ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); //将一半放在当前价格的上方,一半放在下方else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval))。ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 使线条看起来更好。}//----return(0);}//+------------------------------------------------------------------+void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY){for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--){string on = ObjectName(iObj);int iPos = StringFind(on, name);如果(iPos < 0)继续。如果(iPos > 0 && where == ONDA_BEGINS)继续。如果(type == EMPTY) ObjectDelete(on);否则如果(type == ObjectType(on))ObjectDelete(on);}}//--- 试着像这样 #property indicator_chart_window #define ONDA_BEGINS 0 #define ONDA_CONTAINS 1 int nLines = 40; // Number of total line to draw //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- for (int ix = 0; ix < nLines; ix++) // delete my horizontal lines { ObjectDelete("tensLines"+ix); } //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double lineInterval = 0.0010; // Interval between lines double normPrice = NormalizeDouble(Close[1],3); // Current price is rounded to nearest "10" for (int ix = 0; ix < nLines; ix++) // Loop span number of times { if(ObjectFind("tensLines"+ix) < 0) ObjectCreate("tensLines"+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // Place half above and half below the current price else ObjectSet("tensLines"+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval)); ObjectSet("tensLines"+ix,OBJPROP_COLOR,DarkSlateGray); // Make the lines look better } //---- return(0); } //+------------------------------------------------------------------+ void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY) { for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--) { string on = ObjectName(iObj); int iPos = StringFind(on, name); if (iPos < 0) continue; if (iPos > 0 && where == ONDA_BEGINS) continue; if (type == EMPTY) ObjectDelete(on); else if (type == ObjectType(on)) ObjectDelete(on); } } Johanson2424 2016.08.15 23:47 #6669 嘿,伙计们,想雇人用python为我写一些代码,愿意为一些人的工作付费,或者如果有人免费做,那也很酷,但只要在任何时候给我回复,让我知道是否有人能帮助我,一旦我得到某人的注意,我会进入更多的细节。 这将是关于布林带 主要与其他几个指标。 谢谢所有的帮助,伙计们! murnathan32 2016.08.16 06:40 #6670 mladen:像这样试试哇哦。你就是那个人。谢谢mladen的祝福。还有一个请求。你能不能像下面的附件/图片那样把网格做成矩形。 例如,每个矩形有10个点。让矩形来预测 未来。我觉得这比默认的网格更容易让人看懂。而且只需要半秒钟就能看到你所看到的多少个点的移动。 ObjectCreate("Rect02", OBJ_RECTANGLE, 0, Time[0], Bid, Time[Bars], (Bid+0.0010) ); //make bar above cur price ObjectSet("Rect02", OBJPROP_COLOR, Silver ); } //================= Move the Rect with new ticks/candles =========================== else { ObjectMove("Rect01", 0, Time[0], WindowPriceMin()*0.95); ObjectMove("Rect02", 0, Time[0], Bid); } 附加的文件: RoundPips.mq4 3 kb newnbarscmq4.jpg 105 kb 1...660661662663664665666667668669670671672673674...786 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
我需要有人帮我把这个ema交叉点变成一个EA。当蓝色箭头出现时开仓买入,当红色箭头出现时卖出,当箭头旁边的蜡烛关闭时退出交易,请让SL和TP可以调整,以及MAs。
对于蜡烛时间,最好使用一些专门的指标(如附件)。
至于周期分离器:它已经是nmc,但你可能想使用附件(它应该在CPU上更轻)。
非常感谢你。 我试图 添加 "BarsLimit" 的选项,但 我没有 成功。 请你帮助我。 非常感谢您的时间。
熵
这是一个添加了该选项的版本
你好,mladen,你能教我解决这个问题吗?
这是我得到的警告。
谢谢你。
你好,mladen,你能教我解决这个问题吗?
这就是我得到的警告。
谢谢你。
首先是这个。
和这个
你好,Mladen。
您能帮我看看这段代码吗,先生,有什么需要修正的吗?
另外,当它进入更高的时间框架时,是否有可能改变从
===> 1分钟 ~ 30分钟 ===> 每10点
===> 1小时 ======> 每50点
===> 4小时,每日 ======> 每100点
===> 每周,每月 ===> 每1000点
希望用矩形代替线,先生。
#property indicator_chart_window
#define ONDA_BEGINS 0
#define ONDA_CONTAINS 1
//+------------------------------------------------------------------+
//|自定义指标初始化函数|
//+------------------------------------------------------------------+
int init()
{
//---- 指标
//----
return(0);
}
//+------------------------------------------------------------------+
//|自定义指标去初始化功能|
//+------------------------------------------------------------------+
int deinit()
{
//----
for (int ix = 0; ix < nLines; ix++) // 删除我的水平线
{
ObjectDelete("tensLines "+ix)。
}
//----
return(0);
}
//+------------------------------------------------------------------+
//|自定义指标迭代函数|
//+------------------------------------------------------------------+
int start()
{
int nLines = 40; // 要画的总线数
double lineInterval = 0.0010; // 线段之间的间隔
double normPrice = NormalizeDouble(Close[1],3); // 当前价格被四舍五入到最接近的 "10"
for (int ix = 0; ix < nLines; ix++) // 循环跨度次数
{
if(ObjectFind("tensLines "+ix) < 0)
ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); //将一半放在当前价格的上方,一半放在下方
else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval))。
ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 使线条看起来更好。
}
//----
return(0);
}
//+------------------------------------------------------------------+
void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY)
{
for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)
{
string on = ObjectName(iObj);
int iPos = StringFind(on, name);
如果(iPos < 0)继续。
如果(iPos > 0 && where == ONDA_BEGINS)继续。
如果(type == EMPTY) ObjectDelete(on);
否则如果(type == ObjectType(on))ObjectDelete(on);
}
}
//---
你好,Mladen。
您能帮我看看这段代码吗,先生,有什么需要修正的吗?
另外,当它进入更高的时间框架时,是否有可能改变从
===> 1分钟 ~ 30分钟 ===> 每10点
===> 1小时 ======> 每50点
===> 4小时,每日 ======> 每100点
===> 每周,每月 ===> 每1000点
希望用矩形代替线,先生。
#property indicator_chart_window
#define ONDA_BEGINS 0
#define ONDA_CONTAINS 1
//+------------------------------------------------------------------+
//|自定义指标初始化函数|
//+------------------------------------------------------------------+
int init()
{
//---- 指标
//----
return(0);
}
//+------------------------------------------------------------------+
//|自定义指标去初始化功能|
//+------------------------------------------------------------------+
int deinit()
{
//----
for (int ix = 0; ix < nLines; ix++) // 删除我的水平线
{
ObjectDelete("tensLines "+ix)。
}
//----
return(0);
}
//+------------------------------------------------------------------+
//|自定义指标迭代函数|
//+------------------------------------------------------------------+
int start()
{
int nLines = 40; // 要画的总线数
double lineInterval = 0.0010; // 线段之间的间隔
double normPrice = NormalizeDouble(Close[1],3); // 当前价格被四舍五入到最接近的 "10"
for (int ix = 0; ix < nLines; ix++) // 循环跨度次数
{
if(ObjectFind("tensLines "+ix) < 0)
ObjectCreate("tensLines "+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); //将一半放在当前价格的上方,一半放在下方
else ObjectSet("tensLines "+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval))。
ObjectSet("tensLines "+ix,OBJPROP_COLOR,DarkSlateGray); // 使线条看起来更好。
}
//----
return(0);
}
//+------------------------------------------------------------------+
void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY)
{
for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)
{
string on = ObjectName(iObj);
int iPos = StringFind(on, name);
如果(iPos < 0)继续。
如果(iPos > 0 && where == ONDA_BEGINS)继续。
如果(type == EMPTY) ObjectDelete(on);
否则如果(type == ObjectType(on))ObjectDelete(on);
}
}
//---
试着像这样
像这样试试
哇哦。你就是那个人。谢谢mladen的祝福。
还有一个请求。你能不能像下面的附件/图片那样把网格做成矩形。 例如,每个矩形有10个点。让矩形来预测 未来。
我觉得这比默认的网格更容易让人看懂。而且只需要半秒钟就能看到你所看到的多少个点的移动。
}