Download MetaTrader 5

Experts: Close@Profit

To add comments, please log in or register
Automated-Trading
Admin
100933
Automated-Trading 2014.07.11 14:37 

Close@Profit:

Expert Advisor that closes orders after defined profit or loss.

Author: Jan Kafka

Hongliang Liu
1237
Hongliang Liu 2014.07.12 08:19  

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

okeysmith
219
okeysmith 2014.07.28 19:13  
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
Yu Tsai
136
Yu Tsai 2014.09.03 20:21  

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, 

nio21
5
nio21 2014.09.25 05:51  

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

thanks

Files:
Graphic.PNG 21 kb
omakao
25
omakao 2015.10.29 01:39  

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   ??

Yogie Pratama
885
Yogie Pratama 2016.01.15 07:18  

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);

        }

Siti Latifah
6894
Siti Latifah 2016.01.15 12:01  
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);
makhasin
6
makhasin 2016.01.24 09:13  
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?
samarshi
35
samarshi 2016.02.16 22:07  

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:
samarshi
35
samarshi 2016.02.17 19:20  

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:
12
To add comments, please log in or register