а вот вам и мой небольшой вклад
наваял сам назвал RoyalBlue
//+------------------------------------------------------------------+
//| RoyalBlue (USD 13-17).mq4 |
//| Copyright © 2011, Viachi Software Corp. |
//|
[email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Viachi Software Corp."
#property link "
[email protected]"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 RoyalBlue
double USD[];
extern int m1_per = 13;
extern int m1_fast = 17;
extern int m5_per = 13;
extern int m5_fast = 17;
extern int m15_per = 13;
extern int m15_fast = 17;
extern int m30_per = 13;
extern int m30_fast = 17;
extern int h1_per = 13;
extern int h1_fast = 17;
extern int h4_per = 13;
extern int h4_fast = 17;
int init()
{
IndicatorShortName("RoyalBlue USD 13-17");
SetIndexStyle(0,DRAW_LINE,2,3);
SetIndexBuffer(0,USD);
SetIndexLabel(0, "USD");
return(0);
}
int deinit()
{
return(0);
}
//Custom indicator iteration function
int start()
{
int limit;
int counted_bars=IndicatorCounted();
// проверка на возможные ошибки
if(counted_bars<0) return(-1);
// последний посчитанный бар будет пересчитан
if(counted_bars>0) counted_bars-=10;
limit=Bars-counted_bars;
// основной цикл
int Price=6;
int Mode=3;
int per1,per2;
switch(Period())
{
case 1: per1 = m1_per; per2 = m1_fast; break;
case 5: per1 = m5_per; per2 = m5_fast; break;
case 15: per1 = m15_per;per2 = m15_fast; break;
case 30: per1 = m30_per;per2 = m30_fast; break;
case 60: per1 = h1_per;per2 = h1_fast; break;
case 240: per1 = h4_per; per2 = h4_fast; break;
}
for(int i=0; i<limit; i++)
{
USD
=
(iMA("EURUSD",0,per1,0,Mode,Price,i)-
iMA("EURUSD",0,per2,0,Mode,Price,i))*10000
+
(iMA("GBPUSD",0,per1,0,Mode,Price,i)-
iMA("GBPUSD",0,per2,0,Mode,Price,i))*10000
+
(iMA("USDCHF",0,per2,0,Mode,Price,i)-
iMA("USDCHF",0,per1,0,Mode,Price,i))*10000
+
(iMA("USDJPY",0,per2,0,Mode,Price,i)-
iMA("USDJPY",0,per1,0,Mode,Price,i))*100
+
(iMA("AUDUSD",0,per1,0,Mode,Price,i)-
iMA("AUDUSD",0,per2,0,Mode,Price,i))*10000
+
(iMA("USDCAD",0,per2,0,Mode,Price,i)-
iMA("USDCAD",0,per1,0,Mode,Price,i))*10000
+
(iMA("NZDUSD",0,per1,0,Mode,Price,i)-
iMA("NZDUSD",0,per2,0,Mode,Price,i))*10000
;
}
return(0);
}