[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 353

 
abolk:

why do you need this information? it most often shows losses

I want to add it to my EA for visual showing, to assess the ratio of balance and funds during the EA operation. I think it shows losses in loss-making Expert Advisors. For profitable Expert Advisors the result should be reversed.
 
Alexandr_nk:

I want to insert it into my EA, for a visual run for clarity, to assess the balance/equity ratio while the EA is running. I think it shows losses on loss-making Expert Advisors. The result should be the opposite on profitable ones.


Is that kind of crap harder to write than a profitable Expert Advisor)?

It is quite simple to display equity with balance:

Comment ("Средства счета = ",AccountEquity(), " / ", "Баланс счета = ",AccountBalance());
I'm lazy about the last 3 days. Well, it's easy there. Go through all orders which belong to the Expert Advisor and have OrderCloseTime() >TimeCurrent()-259200, sum up their profits, and also output them through Comment...
 
Figar0:


Is this kind of crap harder to write than a profitable Expert Advisor)?

Displaying equity with balance is quite simple:

About the last 3 days is lazy ... Well, it's easy there too. Look through all closed orders which belong to the EA and have OrderCloseTime() >TimeCurrent()-259200, summarize their profits, and also output through Comment ...

I'm a complete dummie in MQL, I just wanted to put in a couple of EAs I have in trading for the convenience of displaying them. I don't know what to do with 3 days but I've got the balance and equity, I wish the numbers were bigger and on the right side of the chart, not on the left.) In any case, thanks a lot.
 
Can you people advise a 5-digit brokerage company with MT5?
 
T-G:
Can you people advise a 5-digit brokerage company with MT5?

http://www.alpari.ru/
 
Is it possible to apply the iMA function to iCustom? Let's say I'm dumb and don't know how an indicator was built (or it only exists as an ex4 file). But I may take its values from iCustom. And then I want to smooth these values using terminal means - I've never understood all these i++ periods, I'm not a programmer, I just want to apply iMa(iCustom.....) - is there any way to do it? In short, how can iMa be made from a custom indy?
 
Doldon:
Is it possible to apply the iMA function to iCustom? Let's say I'm dumb and don't know how an indicator was built (or it only exists as an ex4 file). But I may take its values from iCustom. And then I want to smooth these values using terminal means - I've never understood all these i++ periods, I'm not a programmer, I just want to apply iMa(iCustom.....) - is there any way to do it? In short, how can iMa be made from a custom indy?

you speak very poorly of yourself... even i am sitting here wondering if you need an answer and if it will help you...
 
With iCustom, iMaOnArray, a loop and two buffers :)
 
sergeev:

do you think mqh is something special?

#include simply connects the pieces into a single file.

No, I don't:) It's just that there are all sorts of nuances... For example, when I was trying to find out why the EA did not work correctly in test mode, I found an interesting thing - GlobalVariables are rewritten only after the tester is stopped (!!). I.e., there was a code, but GlobalVariables were not copied into gvariables.dat before the Expert Advisor was stopped. I don't know what it is connected with, may be experienced colleagues can advise?

int start()
{
GlobalVariableSet("TEST"+InstrumentIndex(),1);
}     // end

// функция присвоения уникального номера инструменту. в тестовом режиме к уникальному номеру прибавляется 100 (чтобы не смешивать GlobalVariables в режиме торговли и теста).

int InstrumentIndex()
{
int bias;

if(IsTesting())
   {
   bias=100;
   }
else
   {
   bias=0;
   }
 
if(Symbol()=="EURUSD")return(1+bias);
if(Symbol()=="GBPUSD")return(2+bias);
if(Symbol()=="USDCHF")return(3+bias);
if(Symbol()=="AUDUSD")return(4+bias);
if(Symbol()=="EURCHF")return(5+bias);
if(Symbol()=="USDCAD")return(6+bias);
if(Symbol()=="NZDUSD")return(7+bias);
if(Symbol()=="EURGBP")return(8+bias);
if(Symbol()=="GBPCHF")return(9+bias);
if(Symbol()=="USDJPY")return(10+bias);
if(Symbol()=="EURJPY")return(11+bias);
if(Symbol()=="GBPJPY")return(12+bias);
if(Symbol()=="EURAUD")return(14+bias);
 
else return(0);                                                          
}
 
UPD: The idea was to have both EAs working simultaneously in test mode and in trade mode. But it does not work correctly.