one trade a day

 
Hi there, I have no idea of the programming of EA's yet I have an EA now that does automated trades, yet I want this EA to only trade 1 trade every day. The EA has the ability to work with many indicators and when the time is right it opens an order. I work on a 30min time frame. some trades are profitable yet too many trades in a day can turn sour. Please can someone help me with the necessary changes I have to make to have this EA trading only once every day, and closing the open orders at the end of each day. I would really appreciate anyone's help in this regard :)
 

For one trade per day, use below options:

1. Trade on daily chart and open & close trade only at new bar.

2. Get day from any of day functions and ifs different then previously saved then opne & close trades..

 
dineshydv:

For one trade per day, use below options:

1. Trade on daily chart and open & close trade only at new bar.

2. Get day from any of day functions and ifs different then previously saved then opne & close trades..


I would appreciate if you could guide me through the code I have to add to make this EA trade only once every day
 
You do realize that without seeing the code of EA no responsible coder will tell you what to change and where to place the condition required by you. They can write a coupe code lines but where will you stick them in and will you be confident enough to use that EA on a real account?
 
pro_:
You do realize that without seeing the code of EA no responsible coder will tell you what to change and where to place the condition required by you. They can write a coupe code lines but where will you stick them in and will you be confident enough to use that EA on a real account?
Here is the EA, I am sure that the EA does not need to be altered to its function in placing an order, yet and added code is needed to establish if a trade has already been executed or not, so that the EA can only perform 1 trade for the day. I hope I make sense
 
rocktheworld:
Here is the EA, I am sure that the EA does not need to be altered to its function in placing an order, yet and added code is needed to establish if a trade has already been executed or not, so that the EA can only perform 1 trade for the day. I hope I make sense
Files:
 
rocktheworld:
Here is the EA, I am sure that the EA does not need to be altered to its function in placing an order, yet and added code is needed to establish if a trade has already been executed or not, so that the EA can only perform 1 trade for the day. I hope I make sense
Not sure what you have attached but it isn't mql4 it looks like HTML
 
RaptorUK:
Not sure what you have attached but it isn't mql4 it looks like HTML

i had my computer guy check that html, he says that it is a webpage from some company called 4xproject.com


**spam**

edit: i smile every time that i see your little helmet! it looks exactly like my youngest son has for his motorbike!

 
silverstar4x:

i had my computer guy check that html, he says that it is a webpage from some company called 4xproject.com


**spam**

edit: i smile every time that i see your little helmet! it looks exactly like my ten year old has for his dirt bicycle!

I'm glad my Avatar brings a smile to your face . . . it brought a smile to my face too at the time, I was in a Formula 1 car about to drive a few laps round a track, it was for my 40th Birthday. :-)

My F1 experience

 
This is the MQL4 file, could you please take a look and let me know if you can help me with the code to make this EA trade once every day? I appreciate your help Thanx Jack
 
rocktheworld:
Hi there, I have no idea of the programming of EA's yet

Please can someone help me with the necessary changes I have to make to have this EA trading only once every day, and closing the open orders at the end of each day.
  1. Since there are no slaves here, there are only two choices: learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
  2. #define HR2400          86400                   // 24 * 3600
    datetime TimeOfDay(datetime when){  return( when % HR2400          );       }
    datetime DateOfDay(datetime when){  return( when - TimeOfDay(when) );       }
    int      start(){
        static datetime lastTradeOpen;
        datetime now = TimeCurrent(),
                 BOD = DateOfDay(now);
        bool     isTradingAllowed = BOD != lastTradeOpen;
        :
        if (isTradingAllowed){
            CloseAllOrders();
            :
            if (openCondition){
                int ticket = OrderSend(...);
                if (ticket < 0) Alert(...
                else lastTradeOpen = BOD;
        }   }
        :
    see my code
Reason: