Codes

Simplest Hedging EA ever for MetaTrader 4

This EA simply opens two opposing positions at the beginning of the first new bar it comes across. Both positions can win lose or draw. Works best in 5M timeframe and can be optimised using "Open prices only"

Forum

OrderClosePrice() returns incorrect value

Dear community, I'm a newbie here, and I seem to be receiving incorrect results from the MT4 tester (Version 4.00 Build 225) when running this piece of code: if (OrderSelect(ticket, SELECT_BY_TICKET, MODE_HISTORY)==true){ // Closed trade order_closed_bar = Bars; order_states[rec][ORDER_CLOSED_BAR] =