Hi Steve,
With regards to the code below, line 3450...
Code: Select all
if (TimeDayOfWeek(OrderCloseTime()) != TimeDayOfWeek(TimeCurrent()) )
continue;
After the EA have traded for a week a so, shouldnt there be past trades that have the same TimeDayOfWeek as today's trade ?
i.e We closed 3 trades last Monday, and today is Monday again....how does this distinguish between this Monday's trade and last Monday ?
Hopefully, i didnt miss anything here.
Suggested:
Code: Select all
datetime DayOpenTime = iTime(Symbol(),PERIOD_D1,0);
if(OrderOpenTime() >= DayOpenTime)
OverallProfit+= (OrderProfit() + OrderSwap() + OrderCommission() );
In addition, another useful feature perhaps is an equity close that works in tandem with DailyPercentOfBalanceTarget....
Once AccountEquity hits DailyPercentOfBalanceTarget + BufferPercent ....close all open trades. (BufferPercent covers for trading cost and possible slippage)
imo, this makes sense in the light of reducing risk and not staying in the market for too long.
Of course, MTBM could be used for this too, but this should be nice as a add-on feature to the EA.
Cheers
"Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs.Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres."
-Corinthians 13:4-8