I am newbie in mql4 programing , i want write equity profit locker for my EA and input in EA parameters . for example : after %10 or more equity grow , EA will not work until the end current month .
please help me for this
you don't need a 'good for the day' you need a 'good for the month'
so what would need to have is the expert loop through orders
first orders total (for any open)
and orders history
if they are matching to your expert then you can simply get like order profit and of course commission and swap fees(any and all fees applicable) and with a sum total if that is equal to or exceeds your goal for the month then you would then be able to turn off trading until another equation allows trading.
since you have time in mind you will need to query from the order pool loop the time of the trades and with some formatting its possible to do all that easily
heres an example of counting down
for(int GFTDPips=OrdersTotal()-1; GFTDPips>=0; GFTDPips--)
a ticket has been selected(t/f)
if(TimeDayOfYear(OrderOpenTime())==TimeDayOfYear(TimeCurrent()) && OrderSymbol()==_symbol && OrderMagicNumber()==newMagic && OrderComment()==_comment)
then, orders history
for(GFTDPips=OrdersHistoryTotal()-1; GFTDPips>=0; GFTDPips--)
ticket selected (t/f) **all history in terminal to see this information **
so any questions? ive never done anything like youve stated but when the verification is met
you have a return event in the tick/start until that time your expert can trade again
To add comments, please log in or register