Draw arrow on trade exit

 

HI,

Looking for a way to have MT4 draw an arrow on the chart when you exit a trade via the Terminal window. If the exit is via an EA then the ObjectCreate function will achieve this, but what if I want to exit the trade manually ?. Any way to add a marker/arrow at the exit point ?

Thanks.

 
There are no default option that I'm aware of. You'll want to code an Indicator or something which creates the objects for you.
 
redart:
Any way to add a marker/arrow at the exit point ?
Write the code to do it.
    static datetime lastClose;  datetime lastClosePrev = lastClose;
    for(int iPos=0; iPos < OrdersHistoryTotal(); iPos++) if (
        OrderSelect(iPos, SELECT_BY_POS, MODE_HISTORY)  // Only orders w/
    &&  OrderCloseTime()    > lastClosePrev             // not yet processed,
    &&  OrderMagicNumber()  == magic.number             // my magic number
    &&  OrderSymbol()       == Symbol()                 // and my pair.
    &&  OrderType()         <= OP_SELL // Avoid cr/bal forum.mql4.com/32363#325360
    ){
        lastClose = OrderCloseTime();
        draw your arrow
 
WHRoeder:
Write the code to do it.
add OrderClosePrice() 2
 

Thanks for the replies guys. Got it done using the OrdersTotal function in an Indicator as follows :-

 if (OrdersTotal() == 0)
   ObjectCreate("exit", OBJ_ARROW,0,Time[0],Bid);
   ObjectSet("exit", OBJPROP_ARROWCODE, 3);
   return(0);
 
redart:

Thanks for the replies guys. Got it done using the OrdersTotal function in an Indicator as follows :-

wrong