double getResultadoDiarioEA(){ double retorno = 0; datetime dataInicial = getDataInicioPregaoAtual(); datetime dataFinal=TimeCurrent(); HistorySelect(dataInicial, dataFinal); uint total=HistoryDealsTotal(); ulong ticket=0; for(uint i=0; i < total; i++){ ticket = HistoryDealGetTicket(i); if (HistoryDealGetInteger(ticket, DEAL_MAGIC) == meuMagic){ //2 retorno = retorno + HistoryDealGetDouble(ticket, DEAL_PROFIT); } } return retorno; }
If I remove conditionals at line 1 and 2, it works fine getting the profit about time that I want, the problem is that i want to get only a specific EA profit. Doing this bellow i receive 4755 error(trade deal not found). Why it does not work?
double getResultadoDiarioEA(){//probably should have return(retorno);
3rjfx, unfortunately there is no syntax problem because if i remove conditionals at line 1 and 2, it works fine returning all my profit for the this period. My idea is to get a profit only for a specific EA and magic number was supposed for solve this, I don´t understand why its so hard.
You have to debug your code. What are the dates ? How many deals are selected ?
Alain,
dates are fine because without conditionals I get the right value of all my profit for this period. The problem is about getting some information about the deal. I debugged and could check that my deal has no magic number, but I use magic in every order that I send. What I want to know is why mt5 does not save my magic.
Alain,
dates are fine because without conditionals I get the right value of all my profit for this period. The problem is about getting some information about the deal. I debugged and could check that my deal has no magic number, but I use magic in every order that I send. What I want to know is why mt5 does not save my magic.
How are closed your positions, by SL/TP ?
yes, sl or tp.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
If I remove conditionals at line 1 and 2, it works fine getting the profit about time that I want, the problem is that i want to get only a specific EA profit. Doing this bellow i receive 4755 error(trade deal not found). Why it does not work?
double getResultadoDiarioEA(){