//+------------------------------------------------------------------+ //| ForAfterTesting.mq5 | //| Sigma7i | //| sigma7i@mail.ru| //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Sigma7i" #property link "sigma7i@mail.ru" #property version "2.01" #property description "Script ForAfterTesting for changing the display" #property description " of graphical objects created by the strategy tester." #property description " Simplifies the analysis of profitable (parameter ChangeWinners) and" #property description " losing (parameter ChangeLosses) trades" #property description "Note: It is recommended that for every new change" #property description "you open a new chart." //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ #property script_show_inputs //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ enum ShowModification { ChangeOnly, ChangeWinners, ChangeLosses, DontChange }; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ enum TypeOfArrow { BuyArrow, SellArrow, DonotChange }; sinput string textr="Line Modifiers"; // Line Modifiers input ShowModification ShowCondition=ChangeOnly; //What to change input int Width=2; // Width input ENUM_LINE_STYLE Style=STYLE_SOLID; // Style input color BuyColor=C'3,95,172'; // Buy color input color SellColor=C'225,68,29'; // Sell color sinput string texty="Arrow Modifiers"; // Line Modifiers input TypeOfArrow chTypeOfArrow=DonotChange; // An arrow to change input color clrArrow=Blue; // Color //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnStart() { int objectall=ObjectsTotal(0,0,-1); double Line1,Line2; color clrBuy=C'3,95,172', clrSell=C'225,68,29'; long getcolor; string objName; //+------------------------------------------------------------------+ //|Change the line parameters | //+------------------------------------------------------------------+ for(int i=0;iLine2)// If the starting point is higher and the final one is lower - loss { ObjectSetInteger(0,objName,OBJPROP_WIDTH,Width); ObjectSetInteger(0,objName,OBJPROP_COLOR,BuyColor); ObjectSetInteger(0,objName,OBJPROP_STYLE,Style); } } if(getcolor==clrSell) { if(ShowCondition==0) { ObjectSetInteger(0,objName,OBJPROP_WIDTH,Width); ObjectSetInteger(0,objName,OBJPROP_COLOR,SellColor); ObjectSetInteger(0,objName,OBJPROP_STYLE,Style); } if(ShowCondition==1 && Line1>Line2) // If the starting point is higher and the final one is lower - profit { ObjectSetInteger(0,objName,OBJPROP_WIDTH,Width); ObjectSetInteger(0,objName,OBJPROP_COLOR,BuyColor); ObjectSetInteger(0,objName,OBJPROP_STYLE,Style); } else if(ShowCondition==2 && Line1