
インジケータ ⇒
再度差し替えました多分どの通貨ににでも使えるハズ
マダ完全じゃないけど、インターバル( 時間 )
を追加 && 通貨を8つに
ざっと眺めるのにはいいかも

おあとは適当に・・・
↓ 15分足
↓ 再再差し替え
//+------------------------------------------------------------------+
//| PD2.mq4
//| ( Test by sSeia )
//+------------------------------------------------------------------+
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 8
extern int MaxBars = 1000;
extern int TimeOffset = 4;
extern int interval=12;
extern int MAPeriod=1;
extern int MAPrice=0;
extern int MAMode=0;
//---- buffers
double EURJ_Buffer[];
double AUDJ_Buffer[];
double GBPJ_Buffer[];
double EURU_Buffer[];
double AUDU_Buffer[];
double GBPU_Buffer[];
double USDJ_Buffer[];
double EURA_Buffer[];
string Pair[] = {
"EURJPY", "AUDJPY", "GBPJPY", "EURUSD",
"AUDUSD", "GBPUSD", "USDJPY", "EURAUD"};
color Iro[] = {
Red, Yellow, DodgerBlue, Violet,
White, Aqua, Lime, DarkGray};
string NameObj[] = {
"Pj_1", "Pj_2", "Pj_3", "Pj_4",
"Pj_5", "Pj_6", "Pj_7", "Pj_8" };
int xunit, yunit, ttm;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexBuffer(0,EURJ_Buffer); SetIndexBuffer(1,AUDJ_Buffer);
SetIndexBuffer(2,GBPJ_Buffer); SetIndexBuffer(3,EURU_Buffer);
SetIndexBuffer(4,AUDU_Buffer); SetIndexBuffer(5,GBPU_Buffer);
SetIndexBuffer(6,USDJ_Buffer); SetIndexBuffer(7,EURA_Buffer);
//----
for(int j=0;j<=7;j++) {
SetIndexStyle(j,DRAW_LINE,0,2,Iro[j]);
SetIndexLabel(j,NULL);
ObjectCreate(NameObj[j], OBJ_TEXT, 0, 0, 0);
}
//----
xunit = 1; yunit = 1;
ttm = 60 * 60 * interval;
if( StringSubstr(Symbol(),3,3) == "JPY" ) yunit = 100;
else xunit = 100;
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
void deinit() {
for(int j=0;j<=7;j++) ObjectDelete(NameObj[j]);
Comment("");
}
//----
double GetVal(string sym,datetime t1,datetime t2) {
double v1,v2;
v1 = iMA(sym,NULL,MAPeriod,0,MAMode,MAPrice,iBarShift(sym,0,t1));
v2 = iMA(sym,NULL,MAPeriod,0,MAMode,MAPrice,iBarShift(sym,0,t2));
if(v2==0) return(0);
return( v1-v2 );
}
string d2s( double q ) {
string ans;
if( q == 0.0 ) return(" ");
else return(DoubleToStr( q, 1));
}
//--------------------------------------------------------
int start() {
int i, j;
datetime t1,t2;
double bv, v1, v2, v3, v4, v5, v6, v7, v8;
int limit = MathMin(MaxBars,Bars);
limit = MathMin(limit,Bars-IndicatorCounted()+1);
if(limit <1) return;
for(i=Bars-1;i>MaxBars;i--) {
EURJ_Buffer[i] = EMPTY_VALUE; AUDJ_Buffer[i] = EMPTY_VALUE;
GBPJ_Buffer[i] = EMPTY_VALUE; EURU_Buffer[i] = EMPTY_VALUE;
AUDU_Buffer[i] = EMPTY_VALUE; GBPU_Buffer[i] = EMPTY_VALUE;
USDJ_Buffer[i] = EMPTY_VALUE; EURA_Buffer[i] = EMPTY_VALUE;
}
for(i=limit;i>=0;i--) {
t1 = Time[i];
if( Period() < 1440 ) {
t2 = MathFloor((Time[i]+TimeOffset*60*60)/ttm)*ttm-TimeOffset*60*60;
} else {
t2 = MathFloor(Time[i]/2592000)*2592000; //2592000;
}
if(t1==t2) {
EURJ_Buffer[i] = EMPTY_VALUE; AUDJ_Buffer[i] = EMPTY_VALUE;
GBPJ_Buffer[i] = EMPTY_VALUE; EURU_Buffer[i] = EMPTY_VALUE;
AUDU_Buffer[i] = EMPTY_VALUE; GBPU_Buffer[i] = EMPTY_VALUE;
USDJ_Buffer[i] = EMPTY_VALUE; EURA_Buffer[i] = EMPTY_VALUE;
continue;
}
bv = iMA(NULL,NULL,MAPeriod,0,MAMode,MAPrice,iBarShift(NULL,0,t2));
v1 = GetVal(Pair[0],t1,t2)/xunit; v2 = GetVal(Pair[1],t1,t2)/xunit;
v3 = GetVal(Pair[2],t1,t2)/xunit; v4 = GetVal(Pair[3],t1,t2)*yunit;
v5 = GetVal(Pair[4],t1,t2)*yunit; v6 = GetVal(Pair[5],t1,t2)*yunit;
v7 = GetVal(Pair[6],t1,t2)/xunit; v8 = GetVal(Pair[7],t1,t2)*yunit;
EURJ_Buffer[i] = bv + v1; AUDJ_Buffer[i] = bv + v2;
GBPJ_Buffer[i] = bv + v3; EURU_Buffer[i] = bv + v4;
AUDU_Buffer[i] = bv + v5; GBPU_Buffer[i] = bv + v6;
USDJ_Buffer[i] = bv + v7; EURA_Buffer[i] = bv + v8;
}
//----
double clo = Close[0];
double b[8];
b[0] = EURJ_Buffer[0]; b[1] = AUDJ_Buffer[0]; b[2] = GBPJ_Buffer[0];
b[3] = EURU_Buffer[0]; b[4] = AUDU_Buffer[0]; b[5] = GBPU_Buffer[0];
b[6] = USDJ_Buffer[0]; b[7] = EURA_Buffer[0];
double sa[8]; string sf[8];
for(j=0;j<=7;j++) sa[j] = ( b[j]-clo )/Point/10;
for(j=0;j<=7;j++) sf[j] = Pair[j] + ":" + d2s(sa[j]);
for(j=0;j<=7;j++) {
ObjectSet(NameObj[j], OBJPROP_TIME1, Time[0]);
ObjectSet(NameObj[j], OBJPROP_PRICE1, b[j]);
while (StringLen(sf[j]) < 40 ) sf[j] = " " + sf[j];
ObjectSetText(NameObj[j], sf[j], 12, "Arial", Iro[j]);
}
//----
return(0);
}
//+------------------------------------------------------------------+

で転用 




