Suchen Sie in der Schleife nach dem ersten Hoch, das dem Tiefpunkt des bekannten Fraktals entspricht
Das kann man machen, aber ich würde es umgekehrt machen. D.h. suchen Sie zuerst das Hoch der vorherigen (gebildeten) Kerze und dann das letzte Fraktal nach unten. Wenn sie identisch sind, setzen Sie einen Punkt.
Alexey Kozitsyn: Das könnten wir tun, aber ich würde das Gegenteil tun. D.h. wir suchen zuerst das Hoch der vorherigen (gebildeten) Kerze, und dann das letzte Fraktal nach unten. Wenn sie übereinstimmen, setzen wir einen Punkt.
Das verstehe ich nicht. Ich dachte, dass wir das in diesem Zustand tun würden.
if( High[i+1]==Low[isFractalDn()])//максимум первой свечи равен первому фракталу Dn
Die Balkenanzahl des unteren Fraktals ist bekannt
Suchen Sie in der Schleife nach dem ersten Hoch, das dem Tiefpunkt des bekannten Fraktals entspricht
Das könnten wir tun, aber ich würde das Gegenteil tun. D.h. wir suchen zuerst das Hoch der vorherigen (gebildeten) Kerze, und dann das letzte Fraktal nach unten. Wenn sie übereinstimmen, setzen wir einen Punkt.
Das verstehe ich nicht. Ich dachte, dass wir das in diesem Zustand tun würden.
Geben Sie LOGIN und PASSWORD von MQL5.community ein.
Wo genau befindet sich eine Linie?
Entschuldigung, ich bin mit dem Terminal durcheinander gekommen. Natürlich müssen Sie nur den LOGIN von MQL5.community eingeben.
Das verstehe ich nicht. Ich dachte, dass wir das in diesem Zustand tun würden.
Langsam... tun Sie dies...
#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;
}
}
}
//+------------------------------------------------------------------+
Danke, aber es zeigt keine Lebenszeichen...vielleicht habe ich etwas falsch gemacht?
Es sind mehrere Optionen möglich:
Nun, das System ist x64, weil ich 8GB RAM haben, und das System win 10, ok danke trennte die Firewall jetzt wieder versuchen!
Das verstehe ich nicht. Ich dachte, dass wir das in diesem Zustand tun würden.