DislikedThe problem with this ea is it doesnt close the trades it opens after they reach take profit. Please help.Ignored
Please Do Not PM Me With Coding Enquiries
I will code your pivot EAs for no charge 28 replies
I will code your scalping EAs for no charge 163 replies
Oanda MT4 - Indicators and EAs not showing 2 replies
EAs and indicators relating to moutaki... 22 replies
InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply
DislikedThe problem with this ea is it doesnt close the trades it opens after they reach take profit. Please help.Ignored
Dislikedhello coders, anyone can help me figure out the issue with my EA. it`s working fine in Demo account and backtest. but fails to work as expected in live account: the EA place pending orders above and below the price (grid), once a TP is hit the EA should replace the closed order by another pending order at the same entry price. not sure if this related to the 610 build or it`s related to the broker execution . please help me in this issue. thanks for your support. {file}Ignored
double Profit(int Direction)
{
double reward=0;
RefreshRates();
for (int i=OrdersTotal()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS);
if (OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderCloseTime()==0)
{
if(Direction==1 && OrderType()==OP_BUY) reward+=OrderProfit();
if(Direction==2 && OrderType()==OP_SELL) reward+=OrderProfit();
if(Direction==12) reward+=OrderProfit();
}
}
return(reward);
} DislikedHey guys! My MT4 just got updated to builds 625. Now when i compile the EA, it getting this warning error. return value of 'OrderSelect' should be checked Please help! Thanks a lot! double Profit(int Direction) { double reward=0; RefreshRates(); for (int i=OrdersTotal()-1;i>=0;i--) { OrderSelect(i,SELECT_BY_POS); if (OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderCloseTime()==0) { if(Direction==1 && OrderType()==OP_BUY) reward+=OrderProfit(); if(Direction==2 && OrderType()==OP_SELL) reward+=OrderProfit(); if(Direction==12) reward+=OrderProfit();...Ignored
Disliked{quote} I had a look over your EA and it is quite poorly coded. There are a number of issues that really should be addressed. Although they may not be causing problems, for example, I don't understand why you have the input "GoShort" when it is impossible that the EA will ever open a short(sell) position. The Ea relies on the broker adding tp or sl to the order comment before it will open additional pending orders. If your live broker does not do this, the EA will not function as you expect.Ignored
Disliked{quote} Hi Fxdaytrader, Thank you again for your great work. Before some days you created for me FxFish018_ComboIndicator v1.1.mq4Ignored
Disliked{quote} That is a warning You do not check that the OrderSelect was successful and so subsequent code may use a previously selected order's detailsIgnored
Disliked{quote} How do i get rid of the warning? I means which way i should code ? Please use the example in post 3965 that i posted earlier. Because i don't want them show inside my log even it doesn't affect my coding function. Thanks.Ignored
double Profit(int Direction)
{
double reward=0;
RefreshRates();
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(!OrderSelect(i,SELECT_BY_POS))
{
Print("Error selecting order. Error code ",GetLastError());
//maybe some code here to deal with the OrderSelect failure
continue;
}
else
if(OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderCloseTime()==0)
{
if(Direction==1 && OrderType()==OP_BUY) reward+=OrderProfit();
if(Direction==2 && OrderType()==OP_SELL) reward+=OrderProfit();
if(Direction==12) reward+=OrderProfit();
}
}
return(reward);
} Disliked{quote} To be honest, I cannot remember a single time that OrderSelect has failed as long as the loop is coded correctly, so the print statement is really to help find errors in the code, if they exist double Profit(int Direction) { double reward=0; RefreshRates(); for(int i=OrdersTotal()-1;i>=0;i--) { if(!OrderSelect(i,SELECT_BY_POS)) { Print("Error selecting order. Error code ",GetLastError()); //maybe some code here to deal with the OrderSelect failure continue; } else if(OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderCloseTime()==0)...Ignored
P5678=OrderSend(Symbol(),OP_SELLSTOP,M6A_Lots_P,EnS3,3,SDS,TDS,M6A,Magic_Num,0,Blue);
void DisplayAlert(string message, int shift)
{
if(shift <= 2 && Time[shift] != lastAlertTime)
{
lastAlertTime = Time[shift];
if (alertsMessage) Alert(message+ Symbol()+ " , "+Period()+ " minutes chart");
if (alertsEmail) SendMail(StringConcatenate(Symbol()," Momentum "),message);
if (alertsSound) PlaySound(NameSound);
if (alertsPushnotification) SendNotification(Symbol()+ " " + TFToStr(Period()) + message + DoubleToStr(Bid, Digits) + " ");
}
}