You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
For some reason I cannot get the current account profit in the OnTester function
This is how I get 0
double OnTester()
{
return(AccountInfoDouble(ACCOUNT_PROFIT));
}
And this is how I get profit:
double OnTester()
{
return(AccountInfoDouble(ACCOUNT_BALANCE)-100000);
}
What are we arguing about? w0 not put
PS There is bound to be a message (perhaps a few lines below)
Glory I agree - all these arguments are so time-consuming, screw them ( arguments ). :)
But so, what's called on the leg - you, I'm sure, know everything perfectly well yourself, but still, if this function is external and declared only through a declaration, there are such modifiers as "const" and "in" and "out". Perhaps there is a flaw in this function. The thing is - if it's a returnable parameter then a warning is given if it's not returned (in case it's returned via "return") and having a second form of function, when the return value is returned via a parameter, a warning should also be given, because it's a returnable value. Otherwise, if the success/failure result was returned via a parameter and the value itself was returned via return, it would be impossible. And success or no success is also ALWAYS returned. In other words - ( http://users.telenet.be/bart.demeyere/C++InOutParameters.html ) here is a solution which has been around for a long time.
But the conversation in general as I noticed nothing about. IMHO, you need to answer such questions, if you do not plan to change anything cardinally in the current implementation something like this :) - "Yes, there is such a problem, it will be solved in the next versions of the program, now we have fixed the code, and we are only fixing errors". No one ( I think even the most inadequate ) will be offended, but just fixing the problem itself is important and necessary.
So whether or not there will be in this version such very ( VERY ) useful modifiers in out and others, they significantly allow to minimize errors.
***
It will take half a day to do all this correspondence. I'm done. :)
For some reason I cannot get the current account profit in the OnTester function
This is how I get 0
double OnTester()
{
return(AccountInfoDouble(ACCOUNT_PROFIT));
}
And this is how I get profit:
double OnTester()
{
return(AccountInfoDouble(ACCOUNT_BALANCE)-100000);
}
Declare a global variable and assign the current balance value to it in OnInit().
In OnTester() calculate the total profit based on the results of all completed transactions:
and output it in OnTester().
And what you are trying to get now is the current unfixed profit, which is zero if all positions are closed.
Glory I agree - all these debates are so time consuming, don't bother with them ( debates ). :)
Will there be in this version such very ( VERY ) useful modifiers in out and others, they allow to minimize errors.
"What are we arguing about?" - is a phrase from my childhood that means "what are we arguing about?
Passing a parameter by reference is exactly what inout means. There are simply implementations that are beyond the compiler's control.
In fact, it is quite easy to analyze the execution flow by entering functions (the example Rashid provided). We deliberately refused this approach. The very reason was that it would increase our compilation time significantly. That's why we chose the simplest way - displaying a warning. Is it better not to produce such a warning? Yes, you should. If you do explicit initialization, there will be no warning.
I also repeat that we have a shortened estimate for logical expressions. It means in your case that if the first ObjectGetDouble returns false (for example, because the object, notice the external to the program, suddenly does not exist), the second ObjectGetDouble will not be called
"What are we arguing about?" - is a phrase from my childhood that means "what are we arguing about?
Passing a parameter by reference is exactly what inout means. There are simply implementations that are beyond the compiler's control.
In fact, it is quite easy to analyze the execution flow by entering functions (the example Rashid provided). We deliberately refused this approach. The very reason was that it would increase our compilation time significantly. That's why we chose the simplest way - displaying a warning. Is it better not to produce such a warning? Yes, you should. If you do explicit initialization, there will be no warning.
I also repeat that we have a shortened estimate for logical expressions. It means in your case that if the first ObjectGetDouble returns false (for example, because the object, notice the external to the program, suddenly doesn't exist), the second ObjectGetDouble will not be called
Right, it won't be called - this is standard behaviour in C code.
Modifiers in and out can be in addition to references. And by default they are always in and out for references. But I can pass a reference with in modifier, which means that this function's parameter is always input and writing into it is not possible even if it is passed by reference. Have you read ? http://users.telenet.be/bart.demeyere/C++InOutParameters.html
There is a const modifier. Passing a constant reference explicitly implies an in parameter without any out. We definitely will not introduce additional entities in, out, inout
There is a const modifier. Passing a constant reference explicitly assumes the parameter in without any out. We definitely will not introduce additional entities in, out, inout
If you won't, you won't. But you must realize that you will not get a decent optimization then. And if there had been OUT in that example, the warning would not have been generated. But all in vain - IMHO - it will take you three minutes but there are much fewer errors. And if you don't want to use it, don't use it. Then everything is as it always is. Just like now. :)
How do you make only OUT without IN? Which means something is always returned, you know, like a function return?
Developers.
1. I take it that the spread on the major pairs has been hammered since May 1993, about 930 weekly bars at the current time?
And in the deep history the bars were built on the basis of days.
Therefore, the Expert Advisor may be tested starting exactly from May 1993 (if we use a TF not less than D1)?
Can we look deeper than May 9, 1993 on GBPUSD (like it is implemented on EURUSD)?Hello.
Can you please explain why when creating a "Graphic Tag" object manually, it doesn't have the specified bmp file for on/off states?
Here's the code:
ObjectCreate(....);
.......
ObjectSetString(0, "ColorLabel", OBJPROP_BMPFILE, 0, "Images\on.bmp");
ObjectSetString(0, "ColorLabel", OBJPROP_BMPFILE, 1, "Images\off.bmp");
The label is created completely correctly, in the specified position, with specified colours, etc., but "Images\on.bmp" and "Images\off.bmp" are not specified. If in the MT5 gui
click on the list of objects and set these files for the marker manually, they will be set. But why doesn't ObjectSetString do that?
What do you think?
What do you think?
Try
ObjectSetString(0, "ColorLabel", OBJPROP_BMPFILE, 0, "\\Images\\on.bmp");
ObjectSetString(0, "ColorLabel", OBJPROP_BMPFILE, 1, "\\Images\\off.bmp");
Changes to the certificate will be coming soon.