Eu estou procurando um procedimento, mql4, que vai me dizer verdadeiro ou falso, quando eu atingir o limite de lucro diário para um par. Eu tentei o seguinte código, mas sempre retorna falso.
Código inserido bool funcGetTodaysProfit () {int int DailyProfitPips = 100; double dblReturnValue = 0, dblDailyProfitPips = intDailyProfitPips * Ponto; para (int i = 0; ilt; OrdersTotal (); i ) {//1 ciclo por ordem de busca se (OrderSelect (i, SELECT_BY_POS, MODE_HISTORY) == false) break; if (OrderMagicNumber ()! = intOrderMagicNumber) continua; if (TimeYear (Hora # 91; 0 # 93;)! = TimeYear (OrderOpenTime ()) TimeDay (Hora # 91; 0 # 93;)! = TimeDay (OrderOpenTime ()) TimeMonth (Hora # 91; 0 # 93; )! = TimeMonth (OrderOpenTime ())) continuar;/não lucra hoje. if (OrderType () == OP_BUY) {dblReturnValue = dblReturnValue (OrderClosePrice () - OrderOpenPrice ());} if (OrderType () == OP_SELL) {dblReturnValue = dblReturnValue (OrderOpenPrice () - OrderClosePrice ());}} (Lucro hoje até agora:, DoubleToStr (dblReturnValue, Digits), \ n, Alvo do lucro:, DoubleToStr (dblDailyProfitPips, Digits)); if (dblReturnValuegt; dblDailyProfitPips) {return (true);} retorno (falso); }
Se alguém puder ajudar, agradeço.