//+------------------------------------------------------------------+ //| BLM Ichimoku Table.mq4 | //| Copyright 2017 by Blm | //| www.facebook.com/adelmarravillaii | //+------------------------------------------------------------------+ #property copyright "Copyright 2017 by Blm" #property link "www.facebook.com/adelmarravillaii" #property version "1.00" #property strict #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ input string Input="";//////Please input the Pairs separated by semicolon (;) without space.///// input string Input2="";//////You must input correct Pair Name available by your broker.///// input string Input3="";// 1% Risque for training input string Input4="";// 2% Risque for Advanced input string Input5="";// 3% Risque for Experinced input string Pairs="EURUSD;GBPUSD;NZDUSD;AUDUSD;XAUUSD;USDCAD;USDCHF;USDJPY;GBPJPY;CADJPY;NZDJPY;CHFJPY;AUDJPY;EURJPY"; //"EURUSD;EURGBP;EURAUD;EURCAD;GBPUSD;GBPCHF;USDJPY;EURJPY;GBPJPY;AUDJPY;NZDJPY;CHFJPY;CADJPY;USDCAD;USDCHF;AUDUSD;NZDUSD" input int ATR_Period=200; double Risque_Reward=1.5; input double Capital=1000; input double Risque_Pourcentage_Par_trade =1; double TP_amplifier=1; double SL_amplifier=1.7; double Daily_Risque = 8 ; string Id="ATRBox"; string PairsArray[100]; double Gains; int OnInit() { //--- indicator buffers mapping StringToArray(Pairs,PairsArray); EditCreate(Id+"PairHead",1020,25,100,25,"Pairs","Verdana",12,ALIGN_CENTER,clrOrange,clrBlack,clrNONE); EditCreate(Id+"LotHead",1220,25,70,25,"Lot","Verdana",12,ALIGN_CENTER,clrDarkBlue,clrLime,clrNONE); // EditCreate(Id+"tp1",1020,20,100,20,"TakeProfit","Verdana",12,ALIGN_CENTER,clrGreen,clrBlack,clrNONE); EditCreate(Id+"sl1",1120,25,100,25,"StopLoss","Verdana",12,ALIGN_CENTER,clrRed,clrBlack,clrNONE); int nexty=50; for(int i=0;iEMA2); Up2=(LWMAf>LWMAs); Down1=(EMA1Adx2)&&(Adx2>Adx1)) { SetEditText(Id+"ttrend2018"+PairsArray[i],CharToStr(74),clrRed); } //--------------------------------------------------------------------------------------------------------// tick= MarketInfo(PairsArray[i],MODE_TICKVALUE); Gains = (AccountEquity()*16)/100; SetEditText(Id+"adxx"+PairsArray[i],DoubleToStr(Adx1,2),clrBlack); SetEditText(Id+"adxx1"+PairsArray[i],DoubleToStr(Adx2,2),clrBlack); SetEditText(Id+"adxx2"+PairsArray[i],DoubleToStr(Adx3,2),clrBlack); HAopen=iCustom(PairsArray[i],PERIOD_M30,"Heiken Ashi",2,0); HAclose=iCustom(PairsArray[i],PERIOD_M30,"Heiken Ashi",3,0); HAopen2=iCustom(PairsArray[i],PERIOD_D1,"Heiken Ashi",2,0); HAclose2=iCustom(PairsArray[i],PERIOD_D1,"Heiken Ashi",3,0); double Renko; SetEditText(Id+"H4tend"+PairsArray[i],DoubleToStr(Di_pl,2),clrBlack); SetEditText(Id+"H4tend2"+PairsArray[i],DoubleToStr(Di_mi,2),clrBlack); /* if(Di_mi>Di_pl)/////// SELL { SetEditText(Id+"ttrend2018"+PairsArray[i],CharToStr(234),clrRed); } else { SetEditText(Id+"ttrend2018"+PairsArray[i],CharToStr(233),clrGreen); } */ if(HAclose>HAopen)/////// BUY { SetEditText(Id+"Trend"+PairsArray[i],CharToStr(233),clrGreen); } if(HAcloseHAopen2)/////// BUY { SetEditText(Id+"Trend2"+PairsArray[i],CharToStr(233),clrGreen); } if(HAclose20){txt_result=StringSubstr(tmp_txt,0,koma);} if(koma<=0){ if(StringLen(tmp_txt)>0){txt_result=tmp_txt;tmp_txt="";} if(StringLen(tmp_txt)<0){tmp_txt="";break;} } if(txt_result=="")continue; tmp_txt=StringSubstr(tmp_txt,koma+1); ArrayResize(array, arraycount+1); array[arraycount]=txt_result; arraycount++; } } void ObjectsDeleteByPrefix(string prefix) { string ObjName; int strLength = StringLen(prefix); int Count = 0; while (Count < ObjectsTotal()) { ObjName = ObjectName(Count); if (StringSubstr(ObjName, 0, strLength) != prefix) Count++; else ObjectDelete(ObjName); } } bool EditCreate( const string name="Edit", // object name const int x=0, // X coordinate const int y=0, // Y coordinate const int width=50, // width const int height=18, // height const string text="Text", // text const string font="Arial", // font const int font_size=10, // font size const ENUM_ALIGN_MODE align=ALIGN_LEFT, // alignment type const color back_clr=clrNONE, // background color const color clr=clrYellow, // text color color border_clr=clrNONE, ) // priority for mouse click { //--- reset the error value const int sub_window=0; // subwindow index const long chart_ID=0; // chart's ID const bool read_only=true; // ability to edit const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER; // chart corner for anchoring const bool back=false; // in the background const bool selection=false; // highlight to move const bool hidden=true; // hidden in the object list const long z_order=0; if(border_clr==clrNONE)border_clr=(color)ChartGetInteger(0,CHART_COLOR_BACKGROUND,0); // border color ResetLastError(); //--- create edit field if(!ObjectCreate(chart_ID,name,OBJ_EDIT,sub_window,0,0)) { Print(__FUNCTION__, ": failed to create \"Edit\" object! Error code = ",GetLastError()); return(false); } //--- set object coordinates ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x); ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y); //--- set object size ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width); ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height); //--- set the text ObjectSetString(chart_ID,name,OBJPROP_TEXT,text); //--- set text font ObjectSetString(chart_ID,name,OBJPROP_FONT,font); //--- set font size ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size); //--- set the type of text alignment in the object ObjectSetInteger(chart_ID,name,OBJPROP_ALIGN,align); //--- enable (true) or cancel (false) read-only mode ObjectSetInteger(chart_ID,name,OBJPROP_READONLY,read_only); //--- set the chart's corner, relative to which object coordinates are defined ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner); //--- set text color ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); //--- set background color ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr); //--- set border color ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr); //--- display in the foreground (false) or background (true) ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); //--- enable (true) or disable (false) the mode of moving the label by mouse ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); //--- hide (true) or display (false) graphical object name in the object list ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); //--- set the priority for receiving the event of a mouse click in the chart ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); //--- successful execution return(true); } bool EditDelete(const long chart_ID=0, // chart's ID const string name="Edit") // object name { //---reset the error value ResetLastError(); //--- delete the label if(ObjectFind(0,name)<0)return(true); if(!ObjectDelete(chart_ID,name)) { Print(__FUNCTION__, ": failed to delete \"Edit\" object! Error code = ",GetLastError()); return(false); } // --- successful execution return(true); }