//+------------------------------------------------------------------+
//| QQQ.mq5 |
//| Copyright 2022, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 0
input int sf=5;
input int index=1;
input int bars=140;
input string name="QQE Arrow";
int h=0;
double up[],dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,up,INDICATOR_CALCULATIONS);
SetIndexBuffer(1,dn,INDICATOR_CALCULATIONS);
ArraySetAsSeries(up,1);
ArraySetAsSeries(dn,1);
h=iCustom(NULL,0,name,sf);
Comment("");
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
ObjectsDeleteAll(0,0,OBJ_LABEL);
Comment("");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void PutLabel(string nm,string text,int x,int y, color clr)
{
//--- создадим текстовую метку
ObjectCreate(0,nm,OBJ_LABEL,0,0,0);
//--- установим координаты метки
ObjectSetInteger(0,nm,OBJPROP_XDISTANCE,x);
ObjectSetInteger(0,nm,OBJPROP_YDISTANCE,y);
//--- установим угол графика, относительно которого будут определяться координаты точки
ObjectSetInteger(0,nm,OBJPROP_CORNER,0);
//--- установим текст
ObjectSetString(0,nm,OBJPROP_TEXT,text);
//--- установим шрифт текста
ObjectSetString(0,nm,OBJPROP_FONT,"Verdana");
//--- установим размер шрифта
ObjectSetInteger(0,nm,OBJPROP_FONTSIZE,12);
//--- установим цвет
ObjectSetInteger(0,nm,OBJPROP_COLOR,clr);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
CopyBuffer(h,2,0,bars,up);
CopyBuffer(h,3,0,bars,dn);
ArraySort(up);
ArraySort(dn);
int n=0;
string s="";
for(int i=0; i<bars; i++)
{
if(up[i]>0)
n++;
s+="\n"+(string)NormalizeDouble(up[i],2)+" "+(string)NormalizeDouble(dn[i],2);
}
PutLabel("max","Максимальный селл сигнал: "+string(NormalizeDouble(dn[index],_Digits)),11,22,Red);
PutLabel("min","Минимальный бай сигнал: " +string(NormalizeDouble(up[n-index-1],_Digits)),11,44,DodgerBlue);
Comment(s);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| QQQ.mq5 |
//| Copyright 2022, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 0
input int sf=5;
input int index=1;
input int bars=140;
input string name="QQE Arrow";
int h=0;
double up[],dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,up,INDICATOR_CALCULATIONS);
SetIndexBuffer(1,dn,INDICATOR_CALCULATIONS);
ArraySetAsSeries(up,1);
ArraySetAsSeries(dn,1);
h=iCustom(NULL,0,name,sf);
Comment("");
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
ObjectsDeleteAll(0,0,OBJ_LABEL);
Comment("");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void PutLabel(string nm,string text,int x,int y, color clr)
{
//--- создадим текстовую метку
ObjectCreate(0,nm,OBJ_LABEL,0,0,0);
//--- установим координаты метки
ObjectSetInteger(0,nm,OBJPROP_XDISTANCE,x);
ObjectSetInteger(0,nm,OBJPROP_YDISTANCE,y);
//--- установим угол графика, относительно которого будут определяться координаты точки
ObjectSetInteger(0,nm,OBJPROP_CORNER,0);
//--- установим текст
ObjectSetString(0,nm,OBJPROP_TEXT,text);
//--- установим шрифт текста
ObjectSetString(0,nm,OBJPROP_FONT,"Verdana");
//--- установим размер шрифта
ObjectSetInteger(0,nm,OBJPROP_FONTSIZE,12);
//--- установим цвет
ObjectSetInteger(0,nm,OBJPROP_COLOR,clr);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
CopyBuffer(h,2,0,bars,up);
CopyBuffer(h,3,0,bars,dn);
ArraySort(up);
ArraySort(dn);
int n=0;
for(int i=0; i<bars; i++)
{
if(up[i]>0)
n++;
}
PutLabel("max","Максимальный селл сигнал: "+string(NormalizeDouble(dn[index],_Digits)),11,22,Red);
PutLabel("min","Минимальный бай сигнал: " +string(NormalizeDouble(up[n-index-1],_Digits)),11,44,DodgerBlue);
Comment(n);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
Он торгует не по моему тз
S/L на локальном минимуме.
input group "Input Symbols"
input string TradeSymbol = "EURUSD"; // Trade Symbol
input string IndicatorSymbol = "GBPUSD"; // Indicator Symbol
С помощью советника Ренко. Советник создает пользовательский символ в тестере и в Обзоре рынка
AM2