[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 81

 
Roger >> :

Why is this the case? The order profit is given in pips.

OrderProfit( ) returns the order profit in DEPOSIT VALUE.

If needed in pips, then read the difference of the opening price from the current (or closing) price.

 
goldtrader писал(а) >>

OrderProfit( ) returns the order profit in DEPOSIT VALUE.

If you need it in pips, then count the difference of the opening price from the current (or closing) price.

You are right. But why would you multiply it by points?

 
Roger >> :

The truth is yours. But why did you have to multiply it by points?

Price difference has to be divided by Point to get in pips

 
Reshetov писал(а) >>

The price difference must be divided by Point to get in pips

You seem to have gone a bit the wrong way. The question was.

Ув. знатоки MQL!


extern int PROFIT=20;

if (OrderProfit() > PROFIT) {......}

или

if (OrderProfit() > PROFIT*Point) {.....}


Как правильно?[/
 
Roger >> :

You seem to have gone a bit the wrong way. The question was

If the profit is given in the depo currency, then the first line is correct

The second line is not correct at all

 
Roger >> :

You seem to have gone a bit the wrong way. The question was

No problem statement :(

What is the meaning of the external variable ???

extern int PROFIT=20;

If this variable stores profit in the deposit currency, then the upper if

The lower one is wrong anyway.

If we want to calculate and compare the profit in pips, then there is no correct solution.

.

ZS Reshetov writes faster than I think (((.

 
goldtrader >> :
No problem statement :(

What is the meaning of the external variable ???

If this variable stores profit in the deposit currency, then the upper if condition is correct

The lower one is in any case incorrect.

If we need to calculate and compare the profit in pips, there is no correct solution anywhere.

.

ZS Reshetov writes faster than I think (((

Well, here is the solution !

https://www.youtube.com/watch?v=VgCSyb43MQ8 brutal error )

 

Hello all. Folks, help me out here. I have to return two or three values from void function. I return from the function as usual, via

return(taim_open,flag11)

When compiling, I get this:

')' - wrong parameters count	D:\ïðîãðàììû óñòàíîâëåííûå\ìò4\experts\Êàìàðèëüÿ.mq4 (108, 36)

And if I return only one variable - no error, what have I done wrong?

 
locol91 >> :

Hello all. Hey, guys, help me out here. From void function we need to return two to three values.

A function returns only ONE value at all,

and the one described as void returns none, i.e. it returns nothing.

.

Alternatively, assign these values to global variables within the function.

 
goldtrader писал(а) >>

A function returns only ONE value at all,

and the one described as void returns none, i.e. it returns nothing.

This is correct. But there are variants of solution there is, "peasant" : modification in function/procedure of global variables of program, "civilized" : passing variables to function by reference.

Reason: