started with the m1 basket-settings yesterday and I found something happening with my "crim".
when I activate the ea i get the following screen:
2017-08-08 14_33_48-RDP-Manager.jpg
-->"I have reached my weekly profit target and will not start any more cycles this week."
The ea is not starting any trade on my fresh account (picture below).
2017-08-08 14_38_18-RDP-Manager.jpg
this is the output for my variables:
2017-08-08 14_50_41-RDP-Manager.jpg
I printed the TradingDoneForTheDay and TradingDoneForTheWeek, as you see in the following code.
On the screen it shows false, like it's set in the beginning.
Code: Select all
//Profit targets
text = "";
if (!CloseEnough(DailyProfitTarget, 0) )
text = "Daily profit target = " + DoubleToStr(DailyProfitTarget, 2) + " ";
if (!CloseEnough(WeeklyProfitTarget, 0) )
text = text + "Weekly profit target = " + DoubleToStr(WeeklyProfitTarget, 2);
if (text != "")
SM(text + NL);
if (TradingDoneForTheDay)
if (!TradingDoneForTheWeek)
SM("I have reached my daily profit target and will not start any more cycles today." + NL);
if (TradingDoneForTheWeek)
SM("I have reached my weekly profit target and will not start any more cycles this week." + NL);
SM("var:" + IntegerToString(TradingDoneForTheDay,5) + " var2:" + IntegerToString(TradingDoneForTheWeek,5));
SM("target:"+IntegerToString(HaveWeReachedOurTarget(PERIOD_W1),10));
SM("target:"+DoubleToString(AccumulatedProfit(PERIOD_W1),10));
if (TradingPairs >= MaxPairsAllowed)
SM("You are at your maximum pairs allowed to trade on this account. I shall not initiate any new trading cycles.");
I found that the function AccumulatedProfit(tf) returns the balance of my account.
I adjusted the function (added "&& OrderType()<6"):
Code: Select all
//Profit targets
double AccumulatedProfit(int tf)
{
bool OnlyClosedOrders=False;
datetime starttime = iTime(Symbol(), tf, 0);//Define a starting time based on the passed parameter
double profit = 0; //initialize the profit to calculate
//Iterate through the orders in History and calculate the accumulated profit/loss.
for (int cc = OrdersHistoryTotal() -1; cc >= 0; cc--)
{
if(BetterOrderSelect(cc, SELECT_BY_POS, MODE_HISTORY) )
if(OrderCloseTime() >= starttime && OrderType()<6)
profit += (OrderProfit() + OrderSwap() + OrderCommission() );
}//for (int cc = OrdersHistoryTotal() -1; cc >= 0; cc--)
return(profit);
}//End double AccumulatedProfit(int tf)
Maybe somebody else have this problem too.
Now i will start to find why the ea just shows me only a part of the PairsToTrade
(AUDCAD,AUDCHF,AUDNZD,AUDJPY,AUDUSD,CADCHF,CADJPY,CHFJPY,EURAUD,EURCAD,
EURGBP,EURNZD,EURJPY,EURUSD,GBPJPY,GBPUSD,NZDUSD,NZDJPY,USDCAD,USDCHF,USDJPY)
Regards
You do not have the required permissions to view the files attached to this post.