enum zaliv
{
yes, // Заливаем за воротник
no // Заливаем за кадык
yesx2 // двойная норма
};
enum zaliv
{
yes, // Заливаем за воротник
no // Заливаем за кадык
yesx2 // двойная норма
};
<code>enum zaliv { yes, // ДА no, // нет noYES // Выбираем да и нет }; if(yes) { лялял } if(no) { лялял2 } if(noYES) { лялял3 }</code>
Подскажите пожалуйста код именно для такого типа!
//+------------------------------------------------------------------+
//| Zaliv.mq4 |
//| Copyright 2018, AM2 |
//| http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link "http://www.forexsyatems.biz"
#property version "1.00"
#property strict
enum zaliv
{
yes, // Заливаем за воротник
no // Заливаем за кадык
};
input zaliv buhaem=yes; // Я свою норму знаю!
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| OpenDelta.mq4 |
//| Copyright 2018, AM2 |
//| http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link "http://www.forexsyatems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
input int count=5;
input int up1=200;
input int up2=400;
input int up3=600;
input int dn1=200;
input int dn2=400;
input int dn3=600;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
ObjectsDeleteAll();
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void PutTrendLine(string name,datetime time1,double price1,datetime time2,double price2,color clr)
{
ObjectDelete(0,name);
ObjectCreate(0,name,OBJ_TREND,0,time1,price1,time2,price2);
//--- установим цвет линии
ObjectSetInteger(0,name,OBJPROP_COLOR,clr);
//--- установим толщину линии
ObjectSetInteger(0,name,OBJPROP_WIDTH,2);
//--- включим (true) или отключим (false) режим продолжения отображения линии вправо
ObjectSetInteger(0,name,OBJPROP_RAY_RIGHT,false);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
for(int i=0;i<count;i++)
{
double op=iOpen(NULL,PERIOD_D1,i);
datetime tm=iTime(NULL,PERIOD_D1,i);
datetime tm1=iTime(NULL,PERIOD_D1,i+1);
PutTrendLine("op"+(string)i,tm,op,tm1,op,Red);
PutTrendLine("up1"+(string)i,tm,op+up1*Point,tm1,op+up1*Point,Blue);
PutTrendLine("up2"+(string)i,tm,op+up2*Point,tm1,op+up2*Point,Blue);
PutTrendLine("up3"+(string)i,tm,op+up3*Point,tm1,op+up3*Point,Blue);
PutTrendLine("dn1"+(string)i,tm,op-dn1*Point,tm1,op-dn1*Point,Lime);
PutTrendLine("dn2"+(string)i,tm,op-dn2*Point,tm1,op-dn2*Point,Lime);
PutTrendLine("dn3"+(string)i,tm,op-dn3*Point,tm1,op-dn3*Point,Lime);
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
AM2