If the current day equity is more than the repvious equity

 

Hi Guys,

I wonder if there is a possible way to modify an EA that if the current day equity is more than the previous day then stop trading for the rest of the day and start trading next day...

Can someone please post the script here..

Thanks

 

Anyone who can help please....

Thanks

 

dont know the code myself but if you store current equity in a variable, then open orders, then check the equity when the order is closed against the provious recorded. same thing with date, but if it equals it.

this seems silly to me though since the market is 24/7, surely if your winning you want to stay in? if you could explain please, im curious about your reasons.

 
trevman:
dont know the code myself but if you store current equity in a variable, then open orders, then check the equity when the order is closed against the provious recorded. same thing with date, but if it equals it. this seems silly to me though since the market is 24/7, surely if your winning you want to stay in? if you could explain please, im curious about your reasons.

Well i want to stop trading for the day once my current equity is more then the previous equity...doesnt matter more by how much even if it is up by 10 pips.....its the 1st step towards a new way of increasing you balance i nthe account..

Thanks

 
omelette:
if (TimeDay(Time[0]) > TimeDay(OldTime) + 1 || TimeDay(OldTime) - TimeDay(Time[0]) > 2) {

OldTime = OldTime + 86400;

OldEquity = AccountEquity(); }

if (TimeDay(Time[0]) == TimeDay(OldTime) + 1 || TimeDay(OldTime) - TimeDay(Time[0]) > 2)

if (AccountEquity() > OldEquity)

return;

Hi. I think something along these lines is what you're looking for (haven't tried it though...). Variable 'OldTime' is of type Global, datetime. 'OldEquity' is type Global, double.

thanks for your script but will this stop all the trades for the rest of the day...?

 

This is not a script, just two lines of code that need to be inserted into your EAs code - I assumed you were coding up a strategy........

 
if (TimeDay(Time[0]) > TimeDay(OldTime) + 1 || TimeDay(OldTime) - TimeDay(Time[0]) > 2) {

OldTime = OldTime + 86400;

OldEquity = AccountEquity(); }

if (TimeDay(Time[0]) == TimeDay(OldTime) + 1 || TimeDay(OldTime) - TimeDay(Time[0]) > 2)

if (AccountEquity() > OldEquity)

return;

Hi. I think something along these lines is what you're looking for (haven't tried it though...). Variable 'OldTime' is of type Global, datetime. 'OldEquity' is type Global, double.

Reason: