新人对MQL4和MQL5的任何问题,对算法和代码的帮助和讨论 - 页 803 1...796797798799800801802803804805806807808809810...1953 新评论 Andrei Sokolov 2019.04.07 15:53 #8021 prom18:也许有这样的例子。从视觉上看,这将更容易理解。谢谢你。 如果我没有理解错,你需要某个时间间隔内的条形图,你可以用iTime 选择它们 Igor Makanu 2019.04.07 18:21 #8022 prom18:你好。我在读一本教科书。这里有一些关于如何编写指标的例子。我有一个关于 separatewindow.mq4 指标的问题。 你可以在那里设置计算栏的数量。如果你需要指定从当天的开盘价(或从零开始)到当天的收盘价的计算呢?我应该如何做呢?我试图搜索解决方案,但没有找到。以下是当前时间框架下的当天开盘价 //+------------------------------------------------------------------+ //| DayOpen.mq4 | //| Copyright 2018, IgorM | //| https://www.mql5.com/ru/users/igorm | //+------------------------------------------------------------------+ #property copyright "Copyright 2019, IgorM" #property link "https://www.mql5.com/ru/users/igorm" #property version "1.00" #property strict #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 //--- plot Label1 #property indicator_label1 "Label1" #property indicator_type1 DRAW_LINE #property indicator_color1 clrRed #property indicator_style1 STYLE_SOLID #property indicator_width1 1 //--- indicator buffers double Label1Buffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,Label1Buffer); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ 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[]) { int i,limit; static double dayopen=0.0; static int lastday=0; if(prev_calculated==0) { limit=rates_total-1; dayopen=0.0; lastday=0; } else limit=rates_total-prev_calculated; for(i=limit; i>=0; i--) { if(TimeDay(time[i])!=lastday) { dayopen=open[i]; lastday= TimeDay(time[i]); } Label1Buffer[i]=dayopen; } return(rates_total); } Sfinks35 2019.04.07 18:49 #8023 你好!是否可以通过条件找到历史上给定条形的右边的条形? 谢谢你。 Artyom Trishkin 2019.04.07 18:49 #8024 Sfinks35:你好!是否可以通过条件找到历史上给定条形的右边的条形? 谢谢你。 是的,我们可以。 Sfinks35 2019.04.07 18:54 #8025 Artyom Trishkin:你可以。 你是如何做到的?请告诉我。 Artyom Trishkin 2019.04.07 18:58 #8026 Sfinks35: 你是如何做到的?你能告诉我这一点吗?你如何找到一个特定的酒吧? Sfinks35 2019.04.07 19:02 #8027 Artyom Trishkin:你如何找到一个特定的酒吧? 我花了很长时间,但我写了一个这样的函数。 double GetPatt5barsDN(){ double low3 = 0; int index = 0。 for(int i=1; i<20; i++){ 如果((Close[i] > Open[i]) && (Close[i+1] > Open[i+1]) &&(Close[i+2] > Open[i+2]) && //Low[i+2] 在这根蜡烛上需要。(Close[i+3] < Open[i+3]) && (Close[i+4] < Open[i+4]) low3 = Low[i+2]; index = i+2。} return(low3);} prom18 2019.04.07 19:26 #8028 Igor Makanu:这里是当前TF中一天的开盘价 谢谢你,伊戈尔。但我没有正确地表述它。该指标被计算并在指定的条数(本例中为50条)和独立窗口中绘制。它需要的不是开盘价,而是当天的第一根柱子来指示MA。但无论如何,谢谢你。 Andrei Sokolov 2019.04.07 19:28 #8029 Igor Makanu:这里是当前TF上一天的开盘价 你能告诉我,在 int i,limit=prev_calculated==0 ?rates_total-1 : rates_total-prev_calculated; "==" , "?", ": " ? Artyom Trishkin 2019.04.07 19:31 #8030 Sfinks35: 我花了很长时间,但我写了一个这样的函数。同时返回链接所传递的函数参数中的索引 1...796797798799800801802803804805806807808809810...1953 新评论 原因: 取消 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
也许有这样的例子。从视觉上看,这将更容易理解。谢谢你。
你好。我在读一本教科书。这里有一些关于如何编写指标的例子。我有一个关于 separatewindow.mq4 指标的问题。 你可以在那里设置计算栏的数量。如果你需要指定从当天的开盘价(或从零开始)到当天的收盘价的计算呢?我应该如何做呢?我试图搜索解决方案,但没有找到。
以下是当前时间框架下的当天开盘价
你好!是否可以通过条件找到历史上给定条形的右边的条形? 谢谢你。
你好!是否可以通过条件找到历史上给定条形的右边的条形? 谢谢你。
是的,我们可以。
你可以。
你是如何做到的?你能告诉我这一点吗?
你如何找到一个特定的酒吧?
你如何找到一个特定的酒吧?
我花了很长时间,但我写了一个这样的函数。
double GetPatt5barsDN()
{
double low3 = 0;
int index = 0。
for(int i=1; i<20; i++)
{
如果
((Close[i] > Open[i]) &&
(Close[i+1] > Open[i+1]) &&
(Close[i+2] > Open[i+2]) && //Low[i+2] 在这根蜡烛上需要。
(Close[i+3] < Open[i+3]) &&
(Close[i+4] < Open[i+4])
low3 = Low[i+2];
index = i+2。
}
return(low3);
}
这里是当前TF中一天的开盘价
谢谢你,伊戈尔。但我没有正确地表述它。该指标被计算并在指定的条数(本例中为50条)和独立窗口中绘制。它需要的不是开盘价,而是当天的第一根柱子来指示MA。但无论如何,谢谢你。
这里是当前TF上一天的开盘价
你能告诉我,在
int i,limit=prev_calculated==0 ?rates_total-1 : rates_total-prev_calculated;
"==" , "?", ": "
?
我花了很长时间,但我写了一个这样的函数。
同时返回链接所传递的函数参数中的索引