//+------------------------------------------------------------------+ //| HTd_RF_Vol_Ind.mq4 | //| "syedadil10@gmail.com"| //+------------------------------------------------------------------+ #property copyright "Adil Syed" #property link "syedadil10@gmail.com" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 DeepSkyBlue //Yellow #property indicator_color2 Red //---- input parameters extern int TF1 = 5; extern int TF2 = 15; extern int TF3 = 30; extern string Display_Buy_Sell = "Y"; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double Volatility_TF1 = iCustom(NULL,TF1,"DM_Volatility",0,0); double Volatility_TF1_P = iCustom(NULL,TF1,"DM_Volatility",0,1); string Disp_Vol_TF1 = ""; if (Volatility_TF1 > Volatility_TF1_P) Disp_Vol_TF1 = "Up"; if (Volatility_TF1 < Volatility_TF1_P) Disp_Vol_TF1 = "Dn"; if (Volatility_TF1 == Volatility_TF1_P) Disp_Vol_TF1 = "<>"; double Volatility_TF2 = iCustom(NULL,TF2,"DM_Volatility",0,0); double Volatility_TF2_P = iCustom(NULL,TF2,"DM_Volatility",0,1); string Disp_Vol_TF2 = ""; if (Volatility_TF2 > Volatility_TF2_P) Disp_Vol_TF2 = "Up"; if (Volatility_TF2 < Volatility_TF2_P) Disp_Vol_TF2 = "Dn"; if (Volatility_TF2 == Volatility_TF2_P) Disp_Vol_TF2 = "<>"; double Volatility_TF3 = iCustom(NULL,TF3,"DM_Volatility",0,0); double Volatility_TF3_P = iCustom(NULL,TF3,"DM_Volatility",0,1); string Disp_Vol_TF3 = ""; if (Volatility_TF3 > Volatility_TF3_P) Disp_Vol_TF3 = "Up"; if (Volatility_TF3 < Volatility_TF3_P) Disp_Vol_TF3 = "Dn"; if (Volatility_TF3 == Volatility_TF3_P) Disp_Vol_TF3 = "<>"; //------------------------- double RangeFactor_TF1 = iCustom(NULL,TF1,"DM_RangeFactor",0,0); double RangeFactor_TF1_P = iCustom(NULL,TF1,"DM_RangeFactor",0,1); string Disp_RF_TF1 = ""; if (RangeFactor_TF1 > RangeFactor_TF1_P) Disp_RF_TF1 = "Up"; if (RangeFactor_TF1 < RangeFactor_TF1_P) Disp_RF_TF1 = "Dn"; if (RangeFactor_TF1 == RangeFactor_TF1_P) Disp_RF_TF1 = "<>"; double RangeFactor_TF2 = iCustom(NULL,TF2,"DM_RangeFactor",0,0); double RangeFactor_TF2_P = iCustom(NULL,TF2,"DM_RangeFactor",0,1); string Disp_RF_TF2 = ""; if (RangeFactor_TF2 > RangeFactor_TF2_P) Disp_RF_TF2 = "Up"; if (RangeFactor_TF2 < RangeFactor_TF2_P) Disp_RF_TF2 = "Dn"; if (RangeFactor_TF2 == RangeFactor_TF2_P) Disp_RF_TF2 = "<>"; double RangeFactor_TF3 = iCustom(NULL,TF3,"DM_RangeFactor",0,0); double RangeFactor_TF3_P = iCustom(NULL,TF3,"DM_RangeFactor",0,1); string Disp_RF_TF3 = ""; if (RangeFactor_TF3 > RangeFactor_TF3_P) Disp_RF_TF3 = "Up"; if (RangeFactor_TF3 < RangeFactor_TF3_P) Disp_RF_TF3 = "Dn"; if (RangeFactor_TF3 == RangeFactor_TF3_P) Disp_RF_TF3 = "<>"; //------------------------- double Fx_Trend_Bl_TF1 = iCustom(NULL,TF1,"Horace Trend Detector",14,0,0); double Fx_Trend_Rd_TF1 = iCustom(NULL,TF1,"Horace Trend Detector",14,1,0); string Disp_Fx_Trend_TF1 = ""; if (Fx_Trend_Bl_TF1 > Fx_Trend_Rd_TF1) Disp_Fx_Trend_TF1 = "Up"; if (Fx_Trend_Bl_TF1 < Fx_Trend_Rd_TF1) Disp_Fx_Trend_TF1 = "Dn"; if (Fx_Trend_Bl_TF1 == Fx_Trend_Rd_TF1) Disp_Fx_Trend_TF1 = "<>"; double Fx_Trend_Bl_TF2 = iCustom(NULL,TF2,"Horace Trend Detector",14,0,0); double Fx_Trend_Rd_TF2 = iCustom(NULL,TF2,"Horace Trend Detector",14,1,0); string Disp_Fx_Trend_TF2 = ""; if (Fx_Trend_Bl_TF2 > Fx_Trend_Rd_TF2) Disp_Fx_Trend_TF2 = "Up"; if (Fx_Trend_Bl_TF2 < Fx_Trend_Rd_TF2) Disp_Fx_Trend_TF2 = "Dn"; if (Fx_Trend_Bl_TF2 == Fx_Trend_Rd_TF2) Disp_Fx_Trend_TF2 = "<>"; double Fx_Trend_Bl_TF3 = iCustom(NULL,TF3,"Horace Trend Detector",14,0,0); double Fx_Trend_Rd_TF3 = iCustom(NULL,TF3,"Horace Trend Detector",14,1,0); string Disp_Fx_Trend_TF3 = ""; if (Fx_Trend_Bl_TF3 > Fx_Trend_Rd_TF3) Disp_Fx_Trend_TF3 = "Up"; if (Fx_Trend_Bl_TF3 < Fx_Trend_Rd_TF3) Disp_Fx_Trend_TF3 = "Dn"; if (Fx_Trend_Bl_TF3 == Fx_Trend_Rd_TF3) Disp_Fx_Trend_TF3 = "<>"; //---- Comment( "_________________________", "\n","Time Frame ",TF1," ",TF2," ",TF3, "\n", "_________________________", "\n","FX Trend = ",Disp_Fx_Trend_TF1 ," ",Disp_Fx_Trend_TF2 ," ",Disp_Fx_Trend_TF3,//" ", Fx_Trend_Bl_TF1," ", Fx_Trend_Rd_TF1, "\n","Range Factor = ", Disp_RF_TF1 ," ",Disp_RF_TF2 ," ",Disp_RF_TF3, "\n","Volatility = ", Disp_Vol_TF1 ," ",Disp_Vol_TF2," ",Disp_Vol_TF3, "\n", "_________________________"); return(0); } //+------------------------------------------------------------------+