//+------------------------------------------------------------------+ //| Trade_History_Plot.mq4 | //| Copyright © 2011, Gamaushi | //| http://gamaushi.blog81.fc2.com/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, Gamaushi" #property link "http://gamaushi.blog81.fc2.com/" #property indicator_chart_window extern bool magic_num_filtter = false; extern int magic_num = -1; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectsDeleteAll(0,OBJ_ARROW); ObjectsDeleteAll(0,OBJ_TRIANGLE); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //int counted_bars=IndicatorCounted(); //---- for(int i=0;i OrderOpenTime())continue; if(OrderType() == 0){ string buy_open_label = "#" + OrderTicket() + " Buy " + DoubleToStr(OrderLots(),3) + " " + OrderSymbol() + " at " + DoubleToStr(OrderOpenPrice(),Digits); buy_open_label = buy_open_label + "\n" + OrderMagicNumber(); if(ObjectFind(buy_open_label) !=0){ ObjectCreate(buy_open_label,OBJ_ARROW,0,OrderOpenTime(),OrderOpenPrice()); ObjectSet(buy_open_label,OBJPROP_ARROWCODE,1); ObjectSet(buy_open_label,OBJPROP_COLOR,Blue); } string buy_close_label = "#" + OrderTicket() + " Buy " + DoubleToStr(OrderLots(),3) + " " + OrderSymbol() + " at " + DoubleToStr(OrderOpenPrice(),Digits) + " close at " + DoubleToStr(OrderClosePrice(),Digits); if(ObjectFind(buy_close_label) !=0){ ObjectCreate(buy_close_label,OBJ_ARROW,0,OrderCloseTime(),OrderClosePrice()); ObjectSet(buy_close_label,OBJPROP_ARROWCODE,3); ObjectSet(buy_close_label,OBJPROP_COLOR,Blue); } string buy_line_label = "#" + OrderTicket() + " " + DoubleToStr(OrderOpenPrice(),Digits) + " -> " + DoubleToStr(OrderClosePrice(),Digits); if(ObjectFind(buy_line_label) !=0){ ObjectCreate(buy_line_label,OBJ_TRIANGLE,0,OrderOpenTime(),OrderOpenPrice(),OrderCloseTime(),OrderClosePrice(),OrderCloseTime(),OrderClosePrice()); ObjectSet(buy_line_label,OBJPROP_STYLE,STYLE_DOT); ObjectSet(buy_line_label,OBJPROP_COLOR,Blue); ObjectSet(buy_line_label,OBJPROP_BACK,false); } } if(OrderType() == 1){ string sell_open_label = "#" + OrderTicket() + " Sell " + DoubleToStr(OrderLots(),3) + " " + OrderSymbol() + " at " + DoubleToStr(OrderOpenPrice(),Digits); sell_open_label = sell_open_label + "\n" + OrderMagicNumber(); if(ObjectFind(sell_open_label) !=0){ ObjectCreate(sell_open_label,OBJ_ARROW,0,OrderOpenTime(),OrderOpenPrice()); ObjectSet(sell_open_label,OBJPROP_ARROWCODE,1); ObjectSet(sell_open_label,OBJPROP_COLOR,Red); } string sell_close_label = "#" + OrderTicket() + " Sell " + DoubleToStr(OrderLots(),3) + " " + OrderSymbol() + " at " + DoubleToStr(OrderOpenPrice(),Digits) + " close at " + DoubleToStr(OrderClosePrice(),Digits); if(ObjectFind(sell_close_label) !=0){ ObjectCreate(sell_close_label,OBJ_ARROW,0,OrderCloseTime(),OrderClosePrice()); ObjectSet(sell_close_label,OBJPROP_ARROWCODE,3); ObjectSet(sell_close_label,OBJPROP_COLOR,Red); } string sell_line_label = "#" + OrderTicket() + " " + DoubleToStr(OrderOpenPrice(),Digits) + " -> " + DoubleToStr(OrderClosePrice(),Digits); if(ObjectFind(sell_line_label) !=0){ ObjectCreate(sell_line_label,OBJ_TRIANGLE,0,OrderOpenTime(),OrderOpenPrice(),OrderCloseTime(),OrderClosePrice(),OrderCloseTime(),OrderClosePrice()); ObjectSet(sell_line_label,OBJPROP_STYLE,STYLE_DOT); ObjectSet(sell_line_label,OBJPROP_COLOR,Red); ObjectSet(sell_line_label,OBJPROP_BACK,false); } } } //---- return(0); } //+------------------------------------------------------------------+