Git Hub
коротко

php rgb2hex

14 августа 2016, 16:19
protected function rgb2hex($r,$g,$b)
    {
        return '#' . sprintf('%02x', $r) . sprintf('%02x', $g) . sprintf('%02x', $b);
    }
Поделиться
1 комментарий
ad

//+—————————————————————————————————+
//| iBeeJay.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+—————————————————————————————————+
#property copyright «Copyright 2016, MetaQuotes Software Corp.»
#property link «https://www.mql5.com»
#property version «1.00»
#property strict
#property indicator_chart_window

#define MARK_TYPE_BUY OP_BUY
#define MARK_TYPE_SELL OP_SELL

class iBeeJay{
protected:
double ema8;
double sma26;
double cci34;
double cci55;
double rsi26;

bool condition_1_OnBuy(){
return true;
}
bool condition_2_OnBuy(){
return true;
}
bool condition_3_OnBuy(){
return true;
}

void markBarByDate(datetime dt, int iMarkType){

int indexBarOnDate = iBarShift(Symbol(),Period(),dt);

switch(iMarkType){
case MARK_TYPE_BUY:
string markName = «markBuy» + TimeToStr(dt, TIME_DATE|TIME_MINUTES|TIME_SECONDS);
double lowOnDate = iLow(Symbol(),Period(), indexBarOnDate);
ObjectCreate(markName, OBJ_ARROW, 0, dt, lowOnDate);
ObjectSet(markName, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
ObjectSet(markName, OBJPROP_COLOR, clrGreen);
break;
case MARK_TYPE_SELL:
string markNameSell= «markSell» + TimeToStr(dt, TIME_DATE|TIME_MINUTES|TIME_SECONDS);
double highOnDate = iHigh(Symbol(),Period(), indexBarOnDate);
ObjectCreate(markNameSell, OBJ_ARROW, 0, dt, highOnDate);
ObjectSet(markNameSell, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
ObjectSet(markNameSell, OBJPROP_COLOR, clrGreen);
break;
default:
break;
}
//if (markType == MARK_TYPE_BUY ){

// ObjectSet(markName, OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
// ObjectSet(markName, OBJPROP_COLOR, clrGreen);
//}

}

void markBarToSell(){

}

public:
iBeeJay(){

}

void onCalculate(){

if (this.condition_1_OnBuy() && this.condition_2_OnBuy() && this.condition_3_OnBuy()){
this.markBarByDate(Time[1],OP_BUY);
}
}
};

iBeeJay* pIndicator;
//+—————————————————————————————————+
//| Custom indicator initialization function |
//+—————————————————————————————————+
int OnInit()
{
//—- indicator buffers mapping
pIndicator = new iBeeJay();
//—-
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[])
{
//—-

pIndicator.onCalculate();
//—- return value of prev_calculated for next call
return(rates_total);
}
//+—————————————————————————————————+

Популярное