To evaluate someones trading style, its important to see trades visually on chart. Services such as myfxbook or signalauditor does very good analyse of trades and their metrics but to see trades visually gives you other perspective!
Objective
We want to write an indicator which can draw all our history trades from current account to chart. This indicator will draw EURUSD History Trades to EURUSD Chart, it will filter Symbols automatically. Beside this you can filter trades by their MAGICNUMBER or/and Comments (by Input parameters). filterMAGIC input parameters needs to be -1 if you want include all trades. filterComment needs to be empty string to include all trades, otherwise specifify substring of comment or Magicnumber of trades you want to have displayed
Screenshoots
Source code
Basic MQL Code is:
#property copyright "Fx1 Inc, 2015" #property link "Fx1.net" #property version "1.00" #property strict #property indicator_chart_window extern int filterMAGIC=-1; extern string filterComment=""; extern color BuyColor = Gold; extern color SellColor = Tomato; int OnInit() { ObjectsDeleteAll(0,0,OBJ_TREND); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { ObjectsDeleteAll(0,0,OBJ_TREND); } int LastBar=-1; int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { if (Time[1]!=LastBar) { for(int i=0;i<OrdersHistoryTotal();i++) { if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) if (OrderSymbol()==Symbol()) if (filterMAGIC<0 || OrderMagicNumber()==filterMAGIC) if (filterComment=="" || StringFind(OrderComment(),filterComment)>-1) { while (!DrawTrade(OrderTicket())) {} } } LastBar=Time[1]; } return(rates_total); } bool DrawTrade(int Ticket) { if (OrderSelect(Ticket,SELECT_BY_TICKET,MODE_HISTORY)) { string nam="DrawnTrade_"+DoubleToStr(Ticket,0); if(!ObjectCreate(0,nam,OBJ_TREND,0,OrderOpenTime(),OrderOpenPrice(),OrderCloseTime(),OrderClosePrice())) { ObjectSet(nam, OBJPROP_RAY, 0); ObjectSet(nam, OBJPROP_COLOR, OrderType()==OP_BUY ? BuyColor : SellColor); ObjectSet(nam, OBJPROP_WIDTH, 3); return(true); } else{ return(false); } } return(true); }
This is a Metatrader4 Indicator code, simply copy&paste it into your Metaeditor as Indicator and you are done, for lazy people download it from here
Comments
This small code will give you insight about trading style. I am using this code with Investor Password on my Trading Terminal to analyse trades from friends or even myself. This feature needs to be implemented into Metatrader natively. Enjoy using it.