Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 906

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
Hello: Could you tell me how to do this: there is a custom function that has a number of parameters set by default. If the first of the set parameters needs to be left unchanged and the following parameters need to be changed, is it possible to do without rewriting this parameter?
Who knows about the new objects, please tell me which object now serves as a software object, at least only for filling with a given colour with a binding to the upper right corner? I can not find, namely, fill colour, not a frame, and the whole figure, and that with a binding, namely to theupper right corner! Maybe something from old 4 works, because its documentation was thrown out, and this new one is full of restrictions, and possibilities... Thanks!
Hello: Could you tell me how to do this: there is a custom function that has a number of parameters set by default. If the first of the set parameters needs to be left unchanged, and the following parameters need to be changed, can you do without rewriting this parameter?
Well, call it like all the others, you give it what it needs
function call with needed parameters:fNumBar(TimeBar,60,"Bar not found! Job complete.", false, 150);
int fNumBar(datetime TimeBar,int TF, string Text="Bar not found! Work complete.",bool Flag=True,int QBarsForAnalisys=0);
{
here is the function body;
return(return anything or 0);
}
So call it like everyone else, you give it what it needs.
function call with the right parameters:fNumBar(TimeBar,60,"Bar not found! Work complete.", false, 150);
int fNumBar(datetime TimeBar,int TF, string Text="Bar not found! Work complete.",bool Flag=True,int QBarsForAnalisys=0);
{
here is the body of the function;
return(return anything or 0);
}
But is it possible to show the function that the default value should be used without rewriting this string? The compiler understands that if parameters are omitted all the way through, the default value must be used. In that case, is there some magic word to indicate that the default value should be used?
How do you figure? Enter the defaults right away if the variable is inside, if they are at the end, then just don't write them:
int fNumBar(datetime TimeBar,int TF, string Text="Bar not found! Job complete.",bool Flag=True,int QBarsForAnalisys=0);
fNumBar(timebar, timeframe, text); // just don't write further bool Flag=True,int QBarsForAnalisys=0
If the required variable is at the beginning or inside by default, you must specify it, if it is at the end, you can omit it and it will take what you specify.
Also, if you don't use it at all, or it is always constant, then move it to the function body, and thus reduce the design call.
Describe in more detail what you are doing, maybe there is another solution.
Good afternoon !
Please suggest functions in mql4 to return amounts of money from investment requests as well as amounts on withdrawal requests from investors for a PAMM account.
Well, if I understood the task correctly, it's quite an implementation of OBJ_RECTANGLE_LABEL https://docs.mql4.com/ru/constants/objectconstants/enum_object/obj_rectangle_label
Thanks for the response! But it just doesn't simplify it, it complicates it exorbitantly with unnecessary checks, as if I'm sending something to the server, which is why I asked for help! Did it myself yesterday without enums and other wisdom! Works fine, and less than 40 lines of calling code with conditions and along with rectangle and text functions!
Just got stumped at first from the "Yuck" method, then applied my favourite "Yuck" method, and it worked! ;))