#property copyright "prova_hack" #property link "prova_hack" #property indicator_chart_window extern color LongColor = Navy; extern color ShortColor = Fuchsia; int init() { return (0); } int deinit() { for (int l_objs_total_0 = ObjectsTotal(); l_objs_total_0 >= 0; l_objs_total_0--) if (StringSubstr(ObjectName(l_objs_total_0), 0, 1) == "#") ObjectDelete(ObjectName(l_objs_total_0)); return (0); } int start() { string l_name_0; string ls_8; string l_dbl2str_16; string l_str_concat_24; int l_datetime_32; int l_datetime_36; double l_ord_open_price_40; double l_price_48; color l_color_56; for (int l_pos_60 = 0; l_pos_60 < OrdersHistoryTotal(); l_pos_60++) { OrderSelect(l_pos_60, SELECT_BY_POS, MODE_HISTORY); if (OrderType() == OP_BUY) l_color_56 = LongColor; ls_8 = " Buy"; if (OrderType() == OP_SELL) l_color_56 = ShortColor; ls_8 = " Sell"; l_name_0 = "#" + DoubleToStr(OrderTicket(), 0); l_datetime_32 = OrderOpenTime(); l_datetime_36 = OrderCloseTime(); l_ord_open_price_40 = OrderOpenPrice(); l_price_48 = OrderClosePrice(); ObjectCreate(l_name_0 + "a", OBJ_ARROW, 0, l_datetime_32, l_ord_open_price_40); ObjectSet(l_name_0 + "a", OBJPROP_COLOR, l_color_56); if (ls_8 == " Buy") ObjectSet(l_name_0 + "a", OBJPROP_ARROWCODE, 1); if (ls_8 == " Sell") ObjectSet(l_name_0 + "a", OBJPROP_ARROWCODE, 2); l_dbl2str_16 = DoubleToStr(OrderProfit(), 2); l_str_concat_24 = StringConcatenate(l_name_0, "\n", "$", l_dbl2str_16); ObjectCreate(l_str_concat_24, OBJ_ARROW, 0, l_datetime_36, l_price_48); ObjectSet(l_str_concat_24, OBJPROP_COLOR, l_color_56); if (ls_8 == " Buy") ObjectSet(l_str_concat_24, OBJPROP_ARROWCODE, 3); if (ls_8 == " Sell") ObjectSet(l_str_concat_24, OBJPROP_ARROWCODE, 3); ObjectCreate(l_name_0, OBJ_TREND, 0, l_datetime_32, l_ord_open_price_40, l_datetime_36, l_price_48); ObjectSet(l_name_0, OBJPROP_COLOR, l_color_56); ObjectSet(l_name_0, OBJPROP_STYLE, STYLE_DOT); ObjectSet(l_name_0, OBJPROP_BACK, TRUE); ObjectSet(l_name_0, OBJPROP_RAY, FALSE); } return (0); }