#property copyright "eevviill"
#property link "[email protected]"
1)#property indicator_chart_window
extern int TF_ATR = 5;
string TF_ATR3;
int TF_ATR2;
2)int deinit()
{
ObjectDelete("Name ATR TF");
ObjectDelete("TF ATR");
ObjectDelete("ATR");
ObjectDelete("ATR Value");
return;
}
int start()
{
3)int counted_bars = IndicatorCounted();
4)switch(TF_ATR)
{
case 1 : TF_ATR2 = PERIOD_M1; break;
case 5 : TF_ATR2 = PERIOD_M5; break;
case 15 : TF_ATR2 = PERIOD_M15; break;
case 30 : TF_ATR2 = PERIOD_M30; break;
case 60 : TF_ATR2 = PERIOD_H1; break;
case 240 : TF_ATR2 = PERIOD_H4; break;
case 1440 : TF_ATR2 = PERIOD_D1; break;
}
5)double ATR_EURUSD = iATR("EURUSD",TF_ATR2,14,1);
double ATR_EURJPY = (iATR("EURJPY",TF_ATR2,14,1))/100;
double ATR_EURGBP = iATR("EURGBP",TF_ATR2,14,1);
double ATR_EURCHF = iATR("EURCHF",TF_ATR2,14,1);
double ATR_EURCAD = iATR("EURCAD",TF_ATR2,14,1);
double ATR_EURAUD = iATR("EURAUD",TF_ATR2,14,1);
double ATR_EURNZD = iATR("EURNZD",TF_ATR2,14,1);
double ATR_GBPUSD = iATR("GBPUSD",TF_ATR2,14,1);
double ATR_GBPJPY = (iATR("GBPJPY",TF_ATR2,14,1))/100;
double ATR_GBPCHF = iATR("GBPCHF",TF_ATR2,14,1);
double ATR_GBPCAD = iATR("GBPCAD",TF_ATR2,14,1);
double ATR_GBPAUD = iATR("GBPAUD",TF_ATR2,14,1);
double ATR_GBPNZD = iATR("GBPNZD",TF_ATR2,14,1);
double ATR_AUDUSD = iATR("AUDUSD",TF_ATR2,14,1);
double ATR_AUDJPY = (iATR("AUDJPY",TF_ATR2,14,1))/100;
double ATR_AUDCHF = iATR("AUDCHF",TF_ATR2,14,1);
double ATR_AUDCAD = iATR("AUDCAD",TF_ATR2,14,1);
double ATR_AUDNZD = iATR("AUDNZD",TF_ATR2,14,1);
double ATR_NZDUSD = iATR("NZDUSD",TF_ATR2,14,1);
double ATR_NZDJPY = (iATR("NZDJPY",TF_ATR2,14,1))/100;
double ATR_NZDCHF = iATR("NZDCHF",TF_ATR2,14,1);
double ATR_NZDCAD = iATR("NZDCAD",TF_ATR2,14,1);
double ATR_USDJPY = (iATR("USDJPY",TF_ATR2,14,1))/100;
double ATR_USDCHF = iATR("USDCHF",TF_ATR2,14,1);
double ATR_USDCAD = iATR("USDCAD",TF_ATR2,14,1);
double ATR_CADCHF = iATR("CADCHF",TF_ATR2,14,1);
double ATR_CADJPY = (iATR("CADJPY",TF_ATR2,14,1))/100;
double ATR_CHFJPY = (iATR("CHFJPY",TF_ATR2,14,1))/100;
6)double ATR_all = (ATR_EURUSD+ATR_EURJPY+ATR_EURGBP+ATR_EURCHF+ATR_EURCAD+ATR_EURAUD+ATR_EURNZD+
ATR_GBPUSD+ATR_GBPJPY+ATR_GBPCHF+ATR_GBPCAD+ATR_GBPAUD+ATR_GBPNZD+
ATR_AUDUSD+ATR_AUDJPY+ATR_AUDCHF+ATR_AUDCAD+ATR_AUDNZD+
ATR_NZDUSD+ATR_NZDJPY+ATR_NZDCHF+ATR_NZDCAD+
ATR_USDJPY+ATR_USDCHF+ATR_USDCAD+
ATR_CADCHF+ATR_CADJPY+
ATR_CHFJPY)/28;
7)string ATR = DoubleToStr(ATR_all,6);
8)ObjectCreate("Name ATR TF",OBJ_LABEL,0,0,0);
ObjectSet("Name ATR TF",OBJPROP_CORNER,1);
ObjectSet("Name ATR TF", OBJPROP_XDISTANCE,80);
ObjectSet("Name ATR TF", OBJPROP_YDISTANCE, 34);
ObjectSetText("Name ATR TF","Overall ATR TF =",12,"Arrial",Yellow);
9)switch(TF_ATR)
{
case 1 : TF_ATR3 = "M1"; break;
case 5 : TF_ATR3 = "M5"; break;
case 15 : TF_ATR3 = "M15"; break;
case 30 : TF_ATR3 = "M30"; break;
case 60 : TF_ATR3 = "H1"; break;
case 240 : TF_ATR3 = "H4"; break;
case 1440 : TF_ATR3 = "D1"; break;
}
ObjectCreate("TF ATR",OBJ_LABEL,0,0,0);
ObjectSet("TF ATR",OBJPROP_CORNER,1);
ObjectSet("TF ATR", OBJPROP_XDISTANCE,42);
ObjectSet("TF ATR", OBJPROP_YDISTANCE, 30);
ObjectSetText("TF ATR",TF_ATR3,15,"Arrial",OrangeRed);
ObjectCreate("ATR",OBJ_LABEL,0,0,0);
ObjectSet("ATR",OBJPROP_CORNER,1);
ObjectSet("ATR", OBJPROP_XDISTANCE,110);
ObjectSet("ATR", OBJPROP_YDISTANCE, 58);
ObjectSetText("ATR","Overall ATR =",12,"Arrial",Yellow);
ObjectCreate("ATR Value",OBJ_LABEL,0,0,0);
ObjectSet("ATR Value",OBJPROP_CORNER,1);
ObjectSet("ATR Value", OBJPROP_XDISTANCE,22);
ObjectSet("ATR Value", OBJPROP_YDISTANCE, 54);
ObjectSetText("ATR Value",ATR,15,"Arrial",DeepSkyBlue);
return(0);
}