Experts: Close@Profit

 

Close@Profit:

Expert Advisor that closes orders after defined profit or loss.

Author: Jan Kafka

 

how to make sure all the orders closed with no error?

OrderClose and OrderDelete maybe wrong when you close or delete orders

if some orders are not closed in for clause,they may not be close later,as the total profit not match your condition anymore

FYI

 
Sorry i didnt rate the EA, i think my mouse mistakenly clicked 1 star, i have not used the EA so its not fair to give such a rating, i don't know how to delete the rating i would have done that.Sorry for that
 

This is great!  Does any know if it's possible only close the profit order?  Let's say there were 10 buy order in past 10 bar, 3 of them become profit, we only close those 3?

 Thank you very much, 

 

Las ganancias no hay aire coinciden do Condición .... 

thanks

Files:
Graphic.PNG  21 kb
 

dont understand why people need such EA when MT4 does it already ???

you can set your sl / tp  pending order sell limit , buy limit with MT4 so at least you know it will stop.

so why this EA   ??

 

hey, your EA deoesn't close all order.

Please look at the line 265-278

if(OrderType()==OP_BUY)
        {
         OrderClose(OrderTicket(),OrderLots(),Bid,MaxSlippage,Violet);
        }
      if(OrderType()==OP_SELL)
        {
         OrderClose(OrderTicket(),OrderLots(),Ask,MaxSlippage,Violet);

        } 

 

I change it code below to close all order with no error

 


      if(OrderType()==OP_BUY)

        {

         OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),5,Violet);

        }

      if(OrderType()==OP_SELL)

        {

         OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),5,Violet);

        }

 
Yogie Pratama:

hey, your EA deoesn't close all order.

Please look at the line 265-278

if(OrderType()==OP_BUY)
        {
         OrderClose(OrderTicket(),OrderLots(),Bid,MaxSlippage,Violet);
        }
      if(OrderType()==OP_SELL)
        {
         OrderClose(OrderTicket(),OrderLots(),Ask,MaxSlippage,Violet);

        } 

 

I change it code below to close all order with no error

 


      if(OrderType()==OP_BUY)

        {

         OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),5,Violet);

        }

      if(OrderType()==OP_SELL)

        {

         OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),5,Violet);

        }


see here

ticket=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),5,Black);
 
Yu Tsai:

This is great!  Does any know if it's possible only close the profit order?  Let's say there were 10 buy order in past 10 bar, 3 of them become profit, we only close those 3?

 Thank you very much, 

i think this idea was great....anyone can help?
 

Hi there,

I uploaded the EA, unfortunately it did not close any open orders. when I compiled the EA, it was showing lots of warnings and I don't know how to clean or correct those warnings.

Can anyone help?

 

samarshi

rarshi@yahoo.com 

Files:
Close5profit.jpg  330 kb
 

Hi Yogie Pratama,

So please how can you help me in removing those warnings, because with these warnings the EA won't close the orders.

Thank you.

Samarshi

rarshi@yahoo.com


Files:
Close5profit.jpg  330 kb
Reason: