初学者的问题 MQL5 MT5 MetaTrader 5 - 页 654 1...647648649650651652653654655656657658659660661...1503 新评论 [删除] 2016.10.26 14:24 #6531 pako:下层分形的条数是已知的从中,在循环中搜索与已知分形的低点相对应的第一个高点 这可以做到,但我要做的是反过来。即首先找到前一根(形成的)蜡烛的高点,然后再找到最后一根分形的下跌。如果它们是一样的,就加一个点。 mila.com 2016.10.26 14:43 #6532 Alexey Kozitsyn: 我们可以这样做,但我要做的是相反。也就是说,首先我们要找到前一根(形成的)蜡烛的高点,然后是最后一根分形的下跌。如果它们重合,我们就加一个点。 我不明白。我以为这就是我们在做的条件。 if( High[i+1]==Low[isFractalDn()])//максимум первой свечи равен первому фракталу Dn 应该怎么写呢? Ласло Подобедов 2016.10.26 15:01 #6533 Vladimir Karputov: 从MQL5.community输入LOGIN和PASSWORD。 究竟哪里有一条线 附加的文件: capture-20161026-210051.png 132 kb Vladimir Karputov 2016.10.26 15:04 #6534 Ласло Подобедов: 究竟哪里有一条线呢? 对不起,被终端机搞糊涂了。当然,你只需要输入MQL5.community的LOGIN即可。 Ласло Подобедов 2016.10.26 15:10 #6535 Vladimir Karputov: 对不起,被终端机搞糊涂了。当然,你只需要输入MQL5.community的LOGIN即可。 谢谢你,但它没有显示任何生命迹象......也许我做错了什么? 附加的文件: capture-20161026-210913.png 52 kb [删除] 2016.10.26 15:16 #6536 mila.com: 我不明白。我以为这就是我们在做的条件。 if( High[i+1]==Low[isFractalDn()])//максимум первой свечи равен первому фракталу Dn 你是怎么写下来的呢?轻松...这样做...#property copyright "Tapochun"#property link "https://www.mql5.com/ru/users/tapochun"#property version "1.00"#property strict#property indicator_chart_window#property indicator_buffers 2#property indicator_plots 2//---#property indicator_type1 DRAW_ARROW#property indicator_width1 5#property indicator_color1 clrAqua#property indicator_type2 DRAW_ARROW#property indicator_width2 5#property indicator_color2 clrRed//+------------------------------------------------------------------+//| Глобальные переменные |//+------------------------------------------------------------------+double bufSell[];double bufBuy[];//+------------------------------------------------------------------+//| Входные параметры |//+------------------------------------------------------------------+input int inpNum=50; // Количество свечей для поиска последнего фрактала//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int OnInit() { SetIndexBuffer(0,bufBuy); SetIndexBuffer(1,bufSell); SetIndexEmptyValue(0,EMPTY_VALUE); SetIndexEmptyValue(1,EMPTY_VALUE); SetIndexArrow(0,225); SetIndexArrow(1,226); IndicatorDigits(_Digits);//--- 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[]) { if(rates_total<=0 || prev_calculated<0) return( 0 );//--- if(prev_calculated>0) // Если не первый расчет индикатора { } else // Если первый расчет индикатора { ArrayInitialize(bufBuy,EMPTY_VALUE); ArrayInitialize(bufSell,EMPTY_VALUE); //--- for(int i=1; i<rates_total-7; i++) { CheckBuyArrow(low[i],i,i+4,rates_total-3,time); CheckSellArrow(high[i],i,i+4,rates_total-3,time); } }//--- return(rates_total); }//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+void CheckBuyArrow(const double price, const int index, const int first, int last, const datetime &time[] ) { last=(first+inpNum-1<last) ? first+inpNum-1 : last; double iPrice;//--- for(int i=first; i<=last; i++) { iPrice=iFractals(_Symbol,_Period,MODE_UPPER,i); if(iPrice!=EMPTY_VALUE) { if(price==iPrice) { bufBuy[index]=iPrice-10*_Point; Print(__FUNCTION__,": "+TimeToString(time[index])+" - "+TimeToString(time[i])); } return; } } }//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+void CheckSellArrow(const double price, const int index, const int first, int last, const datetime &time[] ) { last=(first+inpNum-1<last) ? first+inpNum-1 : last; double iPrice;//--- for(int i=first; i<=last; i++) { iPrice=iFractals(_Symbol,_Period,MODE_LOWER,i); if(iPrice!=EMPTY_VALUE) { if(price==iPrice) { bufSell[index]=iPrice+10*_Point; Print(__FUNCTION__,": "+TimeToString(time[index])+" - "+TimeToString(time[i])); } return; } } }//+------------------------------------------------------------------+ 只是在指望故事。 Questions from Beginners MQL5 prev_calculated 编码帮助 Vladimir Karputov 2016.10.26 15:33 #6537 Ласло Подобедов: 谢谢,但它没有显示任何生命迹象......也许我做错了什么? 可能有几种可能性。你有一个32位的操作系统。在这种情况下,你是不允许去的。时间很短--加入云需要两分钟。可能的端口被防火墙关闭 - 需要查看代理日志。 Ласло Подобедов 2016.10.26 16:05 #6538 Vladimir Karputov: 有几种选择是可能的。你有一个32位的操作系统。在这种情况下,你是不允许去的。时间并不长--加入云需要两分钟。可能是端口被防火墙封锁了 - 你需要查看代理日志。 系统是x64的,因为我有8GB内存,操作系统是win 10,好的,谢谢你断开了防火墙,现在我将再次尝试! Ласло Подобедов 2016.10.26 16:44 #6539 Ласло Подобедов: 系统是x64的,因为我有8GB内存,系统是win 10,好的,谢谢你断开了防火墙,现在再试一次! 你知道如何找到TCP端口吗?我刚刚下载了metatester单独的... [删除] 2016.10.26 18:23 #6540 mila.com: 我不明白。我以为这就是我们在做的条件。 if( High[i+1]==Low[isFractalDn()])//максимум первой свечи равен первому фракталу Dn 你是怎么写下来的呢? 看看盒子里的东西。 1...647648649650651652653654655656657658659660661...1503 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
下层分形的条数是已知的
从中,在循环中搜索与已知分形的低点相对应的第一个高点
我们可以这样做,但我要做的是相反。也就是说,首先我们要找到前一根(形成的)蜡烛的高点,然后是最后一根分形的下跌。如果它们重合,我们就加一个点。
我不明白。我以为这就是我们在做的条件。
从MQL5.community输入LOGIN和PASSWORD。
究竟哪里有一条线呢?
对不起,被终端机搞糊涂了。当然,你只需要输入MQL5.community的LOGIN即可。
我不明白。我以为这就是我们在做的条件。
轻松...这样做...
#property link "https://www.mql5.com/ru/users/tapochun"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2
//---
#property indicator_type1 DRAW_ARROW
#property indicator_width1 5
#property indicator_color1 clrAqua
#property indicator_type2 DRAW_ARROW
#property indicator_width2 5
#property indicator_color2 clrRed
//+------------------------------------------------------------------+
//| Глобальные переменные |
//+------------------------------------------------------------------+
double bufSell[];
double bufBuy[];
//+------------------------------------------------------------------+
//| Входные параметры |
//+------------------------------------------------------------------+
input int inpNum=50; // Количество свечей для поиска последнего фрактала
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
SetIndexBuffer(0,bufBuy);
SetIndexBuffer(1,bufSell);
SetIndexEmptyValue(0,EMPTY_VALUE);
SetIndexEmptyValue(1,EMPTY_VALUE);
SetIndexArrow(0,225);
SetIndexArrow(1,226);
IndicatorDigits(_Digits);
//---
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[])
{
if(rates_total<=0 || prev_calculated<0)
return( 0 );
//---
if(prev_calculated>0) // Если не первый расчет индикатора
{
}
else // Если первый расчет индикатора
{
ArrayInitialize(bufBuy,EMPTY_VALUE);
ArrayInitialize(bufSell,EMPTY_VALUE);
//---
for(int i=1; i<rates_total-7; i++)
{
CheckBuyArrow(low[i],i,i+4,rates_total-3,time);
CheckSellArrow(high[i],i,i+4,rates_total-3,time);
}
}
//---
return(rates_total);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CheckBuyArrow(const double price,
const int index,
const int first,
int last,
const datetime &time[]
)
{
last=(first+inpNum-1<last) ? first+inpNum-1 : last;
double iPrice;
//---
for(int i=first; i<=last; i++)
{
iPrice=iFractals(_Symbol,_Period,MODE_UPPER,i);
if(iPrice!=EMPTY_VALUE)
{
if(price==iPrice)
{
bufBuy[index]=iPrice-10*_Point;
Print(__FUNCTION__,": "+TimeToString(time[index])+" - "+TimeToString(time[i]));
}
return;
}
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void CheckSellArrow(const double price,
const int index,
const int first,
int last,
const datetime &time[]
)
{
last=(first+inpNum-1<last) ? first+inpNum-1 : last;
double iPrice;
//---
for(int i=first; i<=last; i++)
{
iPrice=iFractals(_Symbol,_Period,MODE_LOWER,i);
if(iPrice!=EMPTY_VALUE)
{
if(price==iPrice)
{
bufSell[index]=iPrice+10*_Point;
Print(__FUNCTION__,": "+TimeToString(time[index])+" - "+TimeToString(time[i]));
}
return;
}
}
}
//+------------------------------------------------------------------+
谢谢,但它没有显示任何生命迹象......也许我做错了什么?
有几种选择是可能的。
系统是x64的,因为我有8GB内存,系统是win 10,好的,谢谢你断开了防火墙,现在再试一次!
我不明白。我以为这就是我们在做的条件。