[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 83

 
Figar0 >> :
Example of passing a parameter by reference, in this case it is not a variable that is passed, but a reference to the memory area where it is stored.

If I am not mistaken, the main problem was not in passing parameters, but in returning SEVERAL values from the function (see question 1)

And the author's variant:

return(taim_open,flag10);

You cannot return multiple values from a function via return.

 
locol91 >> :

Yeah, porridge! I'd even say pilaf :-) . But still we have to sort it all out.

Read the textbook sections - it's well described there, with examples.

 
goldtrader >> :

If I am not mistaken, the main problem was not in passing parameters, but in returning SEVERAL values from the function (see question 1)

And the author's variant:

You cannot return multiple values from a function.

I get it. Inside the void function, depending on the result, a new value is assigned to the global variable. And this new value (as it turned out) should not be returned.

 
locol91 >> :

I get it. Inside the void function, depending on the result, a new value is assigned to the global variable. And this new value (as it turned out) must not be returned.

Exactly.

 
goldtrader писал(а) >>

If I'm not mistaken, the main problem was not about passing parameters, but about returning SEVERAL values from the function (see question 1)

That's right, we came to the point where we have to modify global variables because you can't return multiple values, while a more correct way of this modification is to pass them into the function by reference. If it is a simple transfer, no reference to variables is just not necessary) In an effort to help the man, started to confuse each other :) :beer:

 

Started to make an indicator of percentage change in price on the Mamba and some strange thing after NW Telecom went all the same values and colours are not ntak colored as conceived, the code of this type everywhere the same

............................................

double CH16 = (( (iClose("RTKM",PERIOD_D1,0) * 100 ) / iClose("RTKM", PERIOD_D1, 1) - 100 ) );
color lColor16 = DimGray;
if ( CH16 > 0 )
lColor16 = DarkOliveGreen;
if ( CH16 < 0 )
lColor16 = Maroon;

double CH17 = (( (iClose("URSI",PERIOD_D1,0) * 100 ) / iClose("URSI", PERIOD_D1, 1) - 100 ) );
color lColor17 = DimGray;
if ( CH17 > 0 )
lColor17 = DarkOliveGreen;
if ( CH17 < 0 )
lColor17 = Maroon;

double CH18 = (( (iClose("SPTL",PERIOD_D1,0) * 100 ) / iClose("SPTL", PERIOD_D1, 1) - 100 ) );
color lColor18 = DimGray;
if ( CH18 > 0 )
lColor18 = DarkOliveGreen;
if ( CH18 < 0 )
lColor18 = Maroon;

................................

Who knows what I messed up again?)))


 
Ah, that's it, I've got the brackets and commas wrong again
 

I don't get it:

Print(StrToTime("forexforidiots"));


Time: 1243405200

The question is what kind of time is this? The parameter is wrong but the time is there. The documentation doesn't describe the value to be returned, so how do I catch a conversion error?

 
Roger >> :

Either make ticket static or take the definition out of the start.

Yes yes, make ticket static and everything is fine, thanks for the science. Can you explain the phenomenon? I'd love to know, and what now keep it static all the way?

 
Dimoncheg >> :
Ah, I got it, I messed up with brackets and commas again.

And how do you pour it into MetaTrader? From Quickquick?