#property copyright "Copyright @ 2012, File45" #property indicator_chart_window //thanks: mladen-super moderator FOREX-TSD www.forex-tsd.com who's edits on a previous project provided a template for further endevours. //http://www.forex-tsd.com/expert-advisors-metatrader-4/20171-please-fix-indicator-ea-34.html#post425056 // SL+TP-CP PIP DIST INDI - v2 // USERS CAN PERMANENTLY CHANGE THE DEFAULT SETTINGS BY MODIFYING THE BELOW CODE - EXAMPLES PROVIDED. // * * * * * REMEBER TO COMPILE AND CHECK FOR ERRORS AFTER EVERY MODIFICAION * * * * * extern string PIPS_or_FRACTIONAL_PIPS = "fractional pips = points / 3 & 5 digit pricing"; extern bool Fractional_Pips = true; // Modification examples: = false; extern string HIDE_OPTIONS; extern bool Hide_Order_Text = false; extern bool Hide_OrderTicket = false; extern bool Hide_SL_TP_Price = false; extern bool Hide_Pip_Text = false; extern bool Hide_SL = false; extern bool Hide_TP = false; extern bool Hide_Limit_and_Stop_Orders = false; extern bool Hide_OE_Price = false; extern bool Hide_OE = false; extern string COSMETICS; extern string L_neg_100___to___R_pos_20; // = "- - neg left / pos right + +"; extern int Shift_Text_Left_or_Right = 13; // Modification examples: = 10; = 20; extern color SL_Color = Magenta; // Modification examples: = Red; = Orange; extern color TP_Color = LimeGreen; extern bool Use_OE_Color = false; extern color OE_Color = Gold; extern int SL_TP_Font_Size = 10; extern int OE_Font_Size = 8; extern string FontName = "Arial"; // Modification examples: = "Verdana"; // * * * * * DO NOT MODIFY BEYOND THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING * * * * * --------------------+ // CHANGE_ORDER_TEXT; // Set_at_Max_8_Characters; // BUY_ORDERS; string Buy_TP = "Buy-TP"; // Modification examples: = "Buy"; = B-TP"; string Buy_SL = "Buy-SL"; string Buy_Limit_TP = "BL-TP"; string Buy_Limit_SL = "BL-ST"; // Modification examples: = "BuyLimit"; = "B-Limit"; = "B/Limit" string Buy_Stop_TP = "BS-TP"; string Buy_Stop_SL = "BS-SL"; // SELL_ORDERS; string Sell_SL = "Sell-SL"; string Sell_TP = "Sell-TP"; string Sell_Limit_SL = "SL-SL"; string Sell_Limit_TP = "SL-TP"; string Sell_Stop_SL = "SS-TP"; string Sell_Stop_TP = "SS-TP"; // ORDER EXECUTION string Buy_Limit_OE = "BL-OE"; string Buy_Stop_OE = "BS-OE"; string Sell_Limit_OE = "SL-OE"; string Sell_Stop_OE = "SS-OE"; string Increase_Max_Characters; int xx = 8; // * * * * * NEWBIES SHOULD DEFINETLY NOT BE EDITING BEYOND THIS * * * * * ------------------------------------ --+ color theColor; string gapz1 = " "; // 30 spaces as test string gapz2 = " "; // 2 spaces string starz1 = " * "; string starz2 = " * "; string starz3 = " * "; int Move_Text_L_or_R = 0; string hashz= "#"; double pmod; int p2p; int dig; int Xpips; string Npips; string Fpips; static string text; static string Buyz_SLz_Distance="Buyz+SLz_Distance"; static string BLimitz_SLz_Distance="BLimitz+SLz_Distance"; static string BStopz_SLz_Distance="BStopz+SLz_Distance"; static string Sellz_SLz_Distance="Sellz+SLz_Distance"; static string SLimitz_SLz_Distance="SLimitz+SLz_Distance"; static string SStopz_SLz_Distance="SStopz+SLz_Distance"; static string Buyz_TPz_Distance="Buyz+TPz_Distance"; static string BLimitz_TPz_Distance="BLimitz+TPz_Distance"; static string BStopz_TPz_Distance="BStopz+TPz_Distance"; static string Sellz_TPz_Distance="Sellz+TPz_Distance"; static string SLimitz_TPz_Distance="SLimitz+TPz_Distance"; static string SStopz_TPz_Distance="SStopz+TPz_Distance"; static string BLimitz_OE_Dist="BLimitz_OE_Dist"; static string BStopz_OE_Dist="BStopz_OE_Dist"; static string SLimitz_OE_Dist="SLimitz_OE_Dist"; static string SStopz_OE_Dist="SStopz_OE_Dist"; //--------------------------------------------------------------------- int init() { // Hide Order text if(Hide_Order_Text==true) { Buy_TP=""; Buy_SL=""; Buy_Limit_TP = ""; Buy_Limit_SL = ""; Buy_Stop_TP = ""; Buy_Stop_SL = ""; Sell_SL = ""; Sell_TP = ""; Sell_Limit_SL = ""; Sell_Limit_TP = ""; Sell_Stop_SL = ""; Sell_Stop_TP = ""; Buy_Limit_OE = ""; Buy_Stop_OE = ""; Sell_Limit_OE = ""; Sell_Stop_OE = ""; } // Hide Pips if(Hide_Pip_Text==true){ Npips=""; Fpips="";} else{ Npips=" pps"; Fpips=" f-pps";} // Pip Logic if(Fractional_Pips==true){ pmod=Point; p2p=1; dig=0; } else{ pmod=Point*10; p2p=10; dig=1; } if(Digits==0){ pmod=Point; p2p=1; dig=0; Xpips=1; } // Pip Choice if (Fractional_Pips==true) if(Xpips==1){ Npips=Npips;} else{ Npips=Fpips;} // hash hide if(Hide_OrderTicket==true) hashz=""; // star1 hide if(Hide_OrderTicket==true||Hide_SL_TP_Price==true) starz1=""; // star2 hide if(Hide_OrderTicket==true&&Hide_SL_TP_Price==true) starz2=""; // OE hidden Alert if(Hide_Limit_and_Stop_Orders==true&& Hide_OE==false) Alert("When Limit and Stop Orders are hidden, OEs are hidden."); PlaySound("Alert.wav"); // OE Price choice if(Hide_OE_Price==true||Hide_OrderTicket==true) starz3=""; return(0); } //--------------------------------------------------------------------- int deinit() { DeleteLabels( Buyz_SLz_Distance, BLimitz_SLz_Distance, BStopz_SLz_Distance, Sellz_SLz_Distance, SLimitz_SLz_Distance, SStopz_SLz_Distance, Buyz_TPz_Distance, BLimitz_TPz_Distance, BStopz_TPz_Distance, Sellz_TPz_Distance, SLimitz_TPz_Distance, SStopz_TPz_Distance, BLimitz_OE_Dist, BStopz_OE_Dist, SLimitz_OE_Dist, SStopz_OE_Dist); return(0); } //--------------------------------------------------------------------- int start() { DeleteLabels( Buyz_SLz_Distance, BLimitz_SLz_Distance, BStopz_SLz_Distance, Sellz_SLz_Distance, SLimitz_SLz_Distance, SStopz_SLz_Distance, Buyz_TPz_Distance, BLimitz_TPz_Distance, BStopz_TPz_Distance, Sellz_TPz_Distance, SLimitz_TPz_Distance, SStopz_TPz_Distance, BLimitz_OE_Dist, BStopz_OE_Dist, SLimitz_OE_Dist, SStopz_OE_Dist); int orders= OrdersTotal(); if( orders==0 ) return(0); for (int n=0; n=0; a-- ) { string Buyz_SLz=ObjectName(a); if (StringFind(Buyz_SLz,Buyz_SLz_Distance,0) > -1 ) ObjectDelete(Buyz_SLz); string BLimitz_SLz=ObjectName(a); if (StringFind(BLimitz_SLz,BLimitz_SLz_Distance,0) > -1 ) ObjectDelete(BLimitz_SLz); string BStopz_SLz=ObjectName(a); if (StringFind(BStopz_SLz,BStopz_SLz_Distance,0) > -1 ) ObjectDelete(BStopz_SLz); string Sellz_SLz=ObjectName(a); if (StringFind(Sellz_SLz,Sellz_SLz_Distance,0) > -1 ) ObjectDelete(Sellz_SLz); string SLimitz_SLz=ObjectName(a); if (StringFind(SLimitz_SLz,SLimitz_SLz_Distance,0) > -1 ) ObjectDelete(SLimitz_SLz); string SStopz_SLz=ObjectName(a); if (StringFind(SStopz_SLz,SStopz_SLz_Distance,0) > -1 ) ObjectDelete(SStopz_SLz); string Buyz_TPz=ObjectName(a); if (StringFind(Buyz_TPz,Buyz_TPz_Distance,0) > -1 ) ObjectDelete(Buyz_TPz); string BLimitz_TPz=ObjectName(a); if (StringFind(BLimitz_TPz,BLimitz_TPz_Distance,0) > -1 ) ObjectDelete(BLimitz_TPz); string BStopz_TPz=ObjectName(a); if (StringFind(BStopz_TPz,BStopz_TPz_Distance,0) > -1 ) ObjectDelete(BStopz_TPz); string Sellz_TPz=ObjectName(a); if (StringFind(Sellz_TPz,Sellz_TPz_Distance,0) > -1 ) ObjectDelete(Sellz_TPz); string SLimitz_TPz=ObjectName(a); if (StringFind(SLimitz_TPz,SLimitz_TPz_Distance,0) > -1 ) ObjectDelete(SLimitz_TPz); string SStopz_TPz=ObjectName(a); if (StringFind(SStopz_TPz,SStopz_TPz_Distance,0) > -1 ) ObjectDelete(SStopz_TPz); string BLimitz_OE=ObjectName(a); if (StringFind(BLimitz_OE,BLimitz_OE_Dist,0) > -1 ) ObjectDelete(BLimitz_OE); string BStopz_OE=ObjectName(a); if (StringFind(BStopz_OE,BStopz_OE_Dist,0) > -1 ) ObjectDelete(BStopz_OE); string SLimitz_OE=ObjectName(a); if (StringFind(SLimitz_OE,SLimitz_OE_Dist,0) > -1 ) ObjectDelete(SLimitz_OE); string SStopz_OE=ObjectName(a); if (StringFind(SStopz_OE,SStopz_OE_Dist,0) > -1 ) ObjectDelete(SStopz_OE); } }