DislikedLook raemon dont open trades This is the same thing happened to me last night {image}Ignored
- #3,844
- Jun 7, 2016 9:20am Jun 7, 2016 9:20am
- Joined Nov 2008 | Status: Trader | 4,830 Posts
Our AWESOME IMAGINATION is the true holy grail!
DislikedLook raemon dont open trades This is the same thing happened to me last night {image}Ignored
Disliked{quote} It Is In The Downloads Files Box Up Right This Page Expires 9/6/2016 23:00Ignored
Disliked{quote} Change Lot From 0.17 To 0.10 Or 0.20 Because Standard Lot Step Is 0.10 Not 0.01 In Some CasesIgnored
extern int Start_Time= 20;
extern int End_Time= 5;
int Magic=2016;
double lots;
bool StopTrading=false;
double ProfitPercentGoal=1;
int start() {
//if StopTrading flag is true, close any open trade and do not continue with EA code
if(StopTrading) {
if(Num_Trades_For_Symbol(Symbol(),MagicNum)>0) CloseAllTrades();
return(0);
}
''''''
//When EA sees a new day then rest StopTrading flag to false and allow trading
if (TimeToStr(TimeCurrent(),TIME_DATE)!=TimeToStr(Time[1],TIME_DATE)){
StopTrading=false;
}
.....
//if target lots reached close all trades and stop EA from trading
if(lots>0.21) {
CloseAllTrades();
StopTrading=true;
return(0);
}
.....
//If the EA reaches the Profit Goal, Stop EA trading for this day
if(ProfitPercentGoal>0 && AccountProfit()/AccountBalance()>ProfitPercentGoal) {
CloseAllTrades();
StopTrading=true;
return(0);
}
''''''''
//Ea start and stop times. Place those code before the EA starts to look for any trading
if(!AllowTradesByTime(Start_Times,End_Time) return(0);
return(0);
} // End start() function
// Function to close all trades only with Magic number
void CloseAllTrades() {
bool allclosed = False,trd;
while (!allclosed) {
for(int cnt=0;cnt<OrdersTotal();cnt++) {
if (!OrderSelect(cnt,SELECT_BY_POS) && OrderMagicNumber()!=Magic) continue;
if(OrderType() == OP_BUY) trd=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),10,MediumSeaGreen);
if(OrderType() == OP_SELL) trd=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),10,DarkOrange);
if(OrderType()>OP_SELL) trd=OrderDelete(OrderTicket()); //close pending orders
}
if (Num_Trades_For_Symbol(Symbol(),MagicNum)==0) allclosed = True; // no more open trades? we exit the loop and script
}
}
// Start and End Trade time function
bool AllowTradesByTime(int start_time,int end_time) {
int Current_Time = TimeHour(TimeCurrent());
if (start_time== 0) start_Time = 24; if (end_Time == 0) end_Time = 24; if (Current_Time == 0) Current_Time = 24;
if ( start_Time < End_Time )
if ( (Current_Time < start_Time) || (Current_Time >= end_Time) ) return(false);
if ( start_Time > snd_Time )
if ( (Current_Time < start_Time) && (Current_Time >= end_Time) ) return(false);
return(true);
} DislikedSorry made a mistake on the CloseAllTrades() function, I added the correction below. The correction was to make sure the EA will close only those trades that it is working on. This is for in case a user decides to place the EA on multiple pairs. Remon before using the code please double check for any mistakes. extern int Start_Time= 20; extern int End_Time= 5; int Magic=2016; double lots; bool StopTrading=false; double ProfitPercentGoal=1; int start() { //if StopTrading flag is true, close any open trade and do not continue with EA code if(StopTrading)...Ignored
Disliked{quote} You Can Run This EA On Your 30$ Micro XM Account With 0.01 Lot, It Can Give You About 1$ Easily Every Day (In The Safe Night Period)Ignored
Disliked{quote} Oh Great! Good to hear that. But how can I get this ea, admin seems to delete email addresses. Any further help is appreciated. Thanks Again. RapzyIgnored
Disliked{quote} It Is In The Downloads Files Box Up Right This Page Expires 9/6/2016 23:00Ignored
Disliked{quote} thanks, but which one exactly is it ? There are so many downloads in there and also EA's. I just tried remon_hunt_V26 and it doesnt seem to work well with 0.01 LotIgnored
Disliked{quote} thanks, but which one exactly is it ? There are so many downloads in there and also EA's. I just tried remon_hunt_V26 and it doesnt seem to work well with 0.01 LotIgnored
DislikedAfter going through your thread and getting to test your EA. It is a lot of good work. Reason it is hanging - MT4 & your EA. logs it is creating are too heavy. for 3 days it created a logs file of about 22GB, which is way too high and it makes any system hang. So, i think there should be a way to minimize the logging aspect.Ignored
DislikedYour EA has executed 4 order's today. 3 closed with a small profit totalling 0.07$ Attached have a look at the screenshots and tell me what you think or want me to change {image} {image}Ignored
Disliked{quote} This Is EA Run It To Know The Broker Info If Your Lot Step Is 0.10 Then Your Account Does Not Support 0.01 Lot. So, You Have To Start With 0.10 Lot {file} {image}Ignored