Calculating total profit/loss in orders of the same magic number. - page 2

 
Morteza Khorasani:

I found the error.

Just added a minus sign before stoploss

if (Profit>= takeprofit || Profit<=stoploss)

if (Profit>= takeprofit || Profit<=(-stoploss))
Thank you all for the help

It seems the expert working well.

But I have the warning yet:

 return value of 'OrderClose' should be checked last.mq4 198 8     (in section 4-2-4)


for this line:(section 4-2-4) 

Can this make an error or disfunction in future.?

How can I fix it? 

       OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,Red); 


 

Dear Friends

I have fixed the errors... Expert is now working well.

but I have one warning:


 return value of 'OrderClose' should be checked last.mq4 198 8     (in section 4-2-4)


for this line:(section 4-2-4) 

Can this make an error or disfunction in future.?

How can I fix it? 

       OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,Red);  
 
i m nt able to close when the profit is 0.05..wht is the exact code to close whn the profit of a trade is 0.05..check the screenshot
Files:
 
legendofcibola:
i m nt able to close when the profit is 0.05..wht is the exact code to close whn the profit of a trade is 0.05..check the screenshot

Show your code so far.

I think that all answers have been given in this thread already.

Reason: