Попробую вкратце.
Поначалу пробовал со спредом… но уж он очень чопурный.
Поэтому новая попытка по новой логике.
Есть два кода
Первый:
//+------------------------------------------------------------------+
//| Copyright © 2018, forex-time@mail.ru |
//| Copyright © 2018, mr.aliaksei@yandex.ru |
//| % Алексея Королькова.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2018, forex-time@mail.ru"
#property copyright "Copyright © 2018, mr.aliaksei@yandex.ru"
#property link "http://axe44.opentraders.ru/bio/"
#property version "1.2"
#property strict
//+------------------------------------------------------------------+
//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 LimeGreen
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 DarkGreen
#property indicator_color5 Brown
#property indicator_color6 DarkBlue
#property indicator_color7 Black
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 2
#property indicator_width5 2
#property indicator_width6 2
#property indicator_level1 0.0
#property indicator_level2 0.45
#property indicator_level3 -0.45
#property indicator_levelcolor DarkGray
//--- indicator parameters
input int InpFastEMA=14; // Fast EMA Period
input int Metod =1; // Metod EMA Period 0-3
input string Pereferics="";// Переферикс после названия основной пары. Например EURUSD.m где переферикс .m
//--- indicator buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Buffer5[];
double Buffer6[];
double Buffer7[];
//--- right input parameters flag
bool ExtParameters=false;
string IndName= "% A.K ("+IntegerToString(InpFastEMA)+")";
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit(void)
{
IndicatorDigits(Digits+1);
//--- drawing settings
SetIndexBuffer(0,Buffer1);SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Buffer2);SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(2,Buffer3);SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(3,Buffer4);SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(4,Buffer5);SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(5,Buffer6);SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(6,Buffer7); SetIndexStyle(6,DRAW_ARROW);
SetIndexEmptyValue(6, 0.0); SetIndexArrow(6, 233);
//--- name for DataWindow and indicator subwindow label
IndicatorShortName(IndName);
//--- check for input parameters
if(InpFastEMA<=1 )
{
Print("Wrong input parameters");
ExtParameters=false;
return(INIT_FAILED);
}
else
ExtParameters=true;
//--- initialization done
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
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 = rates_total-prev_calculated-1;
while(i >= 0)
{
double eurusd=(((iMA("EURUSD"+Pereferics,0,InpFastEMA,0,Metod,0,i)+1)/(iMA("EURUSD"+Pereferics,0,InpFastEMA,0,Metod,1,i)+1))-1)*10000;
double eurjpy=(((iMA("EURJPY"+Pereferics,0,InpFastEMA,0,Metod,0,i)+1)/(iMA("EURJPY"+Pereferics,0,InpFastEMA,0,Metod,1,i)+1))-1)*10000;
double usdjpy=(((iMA("USDJPY"+Pereferics,0,InpFastEMA,0,Metod,0,i)+1)/(iMA("USDJPY"+Pereferics,0,InpFastEMA,0,Metod,1,i)+1))-1)*10000;
double eur=(eurusd+eurjpy)/2;
double usd=(-eurusd+usdjpy)/2;
double jpy=-(usdjpy+eurjpy)/2;
Buffer1[i]=ND(eur,1);
Buffer2[i]=ND(usd,1);
Buffer3[i]=ND(jpy,1);
if(ND(eur,1)>=0.45 || ND(eur,1)<=(-0.45)) Buffer4[i]=Buffer1[i];
if(ND(usd,1)>=0.45 || ND(usd,1)<=(-0.45)) Buffer5[i]=Buffer2[i];
if(ND(jpy,1)>=0.45 || ND(jpy,1)<=(-0.45)) Buffer6[i]=Buffer3[i];
Pair(IndName+"EUR","EUR",54,indicator_color1);
Pair(IndName+"USD","USD",28,indicator_color2);
Pair(IndName+"JPY","JPY",5,Blue);
i--;}
for (i = 0; i < Bars; i++) {
if((Buffer1[i]<=0.4 && Buffer1[i]>=(-0.4))&&(Buffer2[i]<=0.4 && Buffer2[i]>=(-0.4))&&(Buffer3[i]<=0.4 && Buffer3[i]>=(-0.4))) {
Buffer7[i] =0.1;
}
}
return(rates_total);}
//+------------------------------------------------------------------+
//|ND - нормализация числа |
//-------------------------------------------------------------------+
double ND(double value, int digits) {
return(NormalizeDouble(value, digits));}
//+------------------------------------------------------------------+
void Pair(string name,string txt, int shift, color col){
int window=WindowFind(IndName);
//если окно не найдено - "текстовые метки" будут созданы в окне графика
if(window<0) window=0;
ObjectCreate(name,OBJ_LABEL,window,0,0,0,0,0,0);
ObjectSet(name,OBJPROP_CORNER,0);
ObjectSet(name,OBJPROP_XDISTANCE,shift);
ObjectSet(name,OBJPROP_YDISTANCE,2);
ObjectSet(name,OBJPROP_CORNER,CORNER_RIGHT_UPPER);
ObjectSetText(name,txt,8,"Arial",col);}
//+------------------------------------------------------------------+
И второй:
—
SymbolsTotal(), SymbolName()
Так к чему это я?
Вот… наверно догадались… Не имея под рукой 43 тарелки с наливной

как то усмотреть за всеми графиками проблематично.
Поэтому предлагаю некоторые вполне адекватные вещи:
1. По мере роста активности через АТR указывать в функции сомеnt() какие инструменты вдруг стали интересны со стороны игроков. То есть где есть движуха — там становится интересно.
П, С, нужен поручитель
Комментарии (0)
Зарегистрируйтесь или авторизуйтесь, чтобы оставить комментарий