amsteronline

Master Trader
Jul 11, 2012
92
1
64
Hey Enivid,

I know that it could be difficult to add new features to an EA that you did not program, but I also know that you have great talents as a programmer and you did make great adjustments to this ea before, therefore I need your help again.

This ea works great and I would like to ask for your help for a tiny adjustment.

As you know, this amazing ea is programmed to trade everyday if NYear, NMonth, NDay are all set to 0. As of right now, when NHour is 0, that simply means the ea will trade at the 0 hour. Now, could you add an option in which if NHour is set to 0, then it would trade every hour. (Nmin could still be anything).

In my opinion, this feature could be an alternative version to this ea which could be useful to traders that would like to trade every hour.

Thank you.
 

Attachments

  • AmazingEA_EveryDay.mq4
    25.2 KB · Views: 31
  • image01.jpg
    image01.jpg
    182.2 KB · Views: 49

amsteronline

Master Trader
Jul 11, 2012
92
1
64
Yes, I was thinking about that too. Perhaps NHour could be any number other then 0-23, perhaps 24 or 25.

what do yo think?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
You could try add some boolean input parameter (e.g. AnyHour). And then change this:
MQL4:
secofnews=NHour*3600+NMin*60;
to this:
MQL4:
if (AnyHour) secofnews=Hour()*3600+NMin*60;
else secofnews=NHour*3600+NMin*60;
Though I am not sure it will work.
 
Last edited:

amsteronline

Master Trader
Jul 11, 2012
92
1
64
Ok, i think we are on the right track. There is only one error message, which says that AnyHour - variable not defined. Perhaps all you have to do is define what "anyHour" means, and then it will work

I attached a screenshot.
 

Attachments

  • image011.jpg
    image011.jpg
    133.5 KB · Views: 34

amsteronline

Master Trader
Jul 11, 2012
92
1
64
more modification

removed....
 

Attachments

  • AmazingEA_EveryDay_AnyHour.mq4
    25.2 KB · Views: 37
  • image001.jpg
    image001.jpg
    130 KB · Views: 50
Last edited:

amsteronline

Master Trader
Jul 11, 2012
92
1
64
Hey Enivid.

I need your help again, this time it should be very simple for you.

Basically, What I would like the EA to do is to place pending orders from PointsAway but Instead of buying higher from PointsAway I would like it to Sell, and from lower from PointsAway to buy instead of sell...the picture I attached will further demonstrate my point.

As it turns out, using this could work better then the original program, as many of my trades became losses.


P.S. I tried to modify this myself but I failed, your help would be deeply appreciated.
 

Attachments

  • image02.png
    image02.png
    48.8 KB · Views: 65
  • AmazingEA_EveryDay_AnyHour.mq4
    25.2 KB · Views: 30
Last edited:

ilaiya

Trader
Aug 2, 2013
1
0
12
Hey guys,

I am using AmazingEA-1[1].1.8.NEW.mq4 and it isnot working.it's simply shutdown.it says "experts is disabled because it is not day of expected news" what i do?
 

amsteronline

Master Trader
Jul 11, 2012
92
1
64
Any thoughts yet on my request?

I'm trying to make amazing EA a better One, since as it is right now, it will only loose money for everybody in the long-run, Can you please help me make the modification as I requested in my previous post (post #71).

Thank you.
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
Any thoughts yet on my request?

I'm trying to make amazing EA a better One, since as it is right now, it will only loose money for everybody in the long-run, Can you please help me make the modification as I requested in my previous post (post #71).

Thank you.
No, sorry. I am not going to implement that modification. I will help you though if you pinpoint some specific problem with MQL code you cannot get through.
 

amsteronline

Master Trader
Jul 11, 2012
92
1
64
No, sorry. I am not going to implement that modification. I will help you though if you pinpoint some specific problem with MQL code you cannot get through.

Yeah, that would be helpful as well. So, As I mentioned before I thought this would be an easy change to be made, and I could not make it work.

From the MQL:
Code:
void [B]OpenBuyStop[/B]()
{
	int ticket,err,tries;
	tries = 0;
	if (!GlobalVariableCheck("InTrade")) {
		while (tries < 3)
		{
			GlobalVariableSet("InTrade", CurTime());  // set lock indicator
			ticket = OrderSend(Symbol(),[B]OP_BUYSTOP[/B],LotsOptimized(),[B]ho,1,hso,htp[/B],TradeComment,Magic,0,Green);
			Write("[B]OpenBuyStop[/B], OrderSend Executed, ticket="+ticket);
			GlobalVariableDel("InTrade");   // clear lock indicator
			if(ticket<=0) {
				Write("Error Occurred : "+ErrorDescription(GetLastError())+" BuyStop @ "+[B]lo[/B]+" SL @ "+[B]lso[/B]+" TP @"+[B]ltp[/B]);
				tries++;
			} else tries = 3;
		}
	}
}

void [B]OpenSellStop[/B]()
{
	int ticket,err,tries;
	tries = 0;
	if (!GlobalVariableCheck("InTrade")) {
		while (tries < 3)
		{
			GlobalVariableSet("InTrade", CurTime());  // set lock indicator
			ticket = OrderSend(Symbol(),[B]OP_SELLSTOP[/B],LotsOptimized(),[B]lo,1,lso,ltp[/B],TradeComment,Magic,0,Red);
			Write("[B]OpenSellStop[/B], OrderSend Executed, ticket="+ticket);
			GlobalVariableDel("InTrade");   // clear lock indicator
			if(ticket<=0) {
				Write("Error Occurred : "+ErrorDescription(GetLastError())+" [B]SellStop[/B] @ "+[B]ho[/B]+" SL @ "+[B]hso[/B]+" TP @"+[B]htp[/B]);
				tries++;
			} else tries = 3;
		}
	}
}

void DoModify()
{
	for (int i = 0; i < OrdersTotal(); i++) {
		OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
		if (OrderSymbol()==Symbol() && (OrderMagicNumber() == Magic) && (OrderType()==[B]OP_BUYSTOP[/B])) {
			if ((OrderOpenPrice()>[B]ho[/B]) || (OrderOpenPrice()<[B]ho[/B])) {
				Write("[B]Buy Stop[/B] was @ "+DoubleToStr(OrderOpenPrice(),5)+", changed to "+DoubleToStr([B]ho[/B],5));
				OrderModify(OrderTicket(),[B]ho,hso,htp[/B],0,Green);
			}
		}
		if (OrderSymbol()==Symbol() && (OrderMagicNumber() == Magic) && (OrderType()==[B]OP_SELLSTOP[/B])) {
			if ((OrderOpenPrice()>[B]lo[/B]) || (OrderOpenPrice()<[B]lo[/B])) {
				Write("[B]Sell Stop[/B] was @ "+DoubleToStr(OrderOpenPrice(),5)+", changed to "+DoubleToStr([B]lo[/B],5));
				OrderModify(OrderTicket()[B],lo,lso,ltp[/B],0,Red);
			}
		}
	}
}


Ok, so basically, all the highlighted areas were modified to either the opposite: ex.: BUYSTOP to SELLSTOP, Buy to Sell, etc, and also ho to lo, hso to lso, htp to lpt, etc and when I made theses changes the EA sometimes simply ignored it, and it just worked as usual, or did not even place pending orders. So I came to the conclusion that the changes that I need to make has to do something with sending pending orders. I'm just not sure what changes I need to make.

Also, there could be other ares in the MQL that needs modifications to make this work, but I am not sure, so far this is as far as I was.
 

Attachments

  • AmazingEA_EveryDay_AnyHour.mq4
    25.2 KB · Views: 45
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
19,240
1,507
144
Odesa
www.earnforex.com
Obviously, you cannot just swap Buy/Sell here. You need to be issuing Sell Limit orders instead of Buy Stop, and Buy Limit instead of Sell Stop. Entry levels should remain the same, SL/TP should be switched accordingly.
 

amsteronline

Master Trader
Jul 11, 2012
92
1
64
Alright. I will work on it when I got some free time, I will let you know if I got it to work, thank you so far for all your help.
 

amsteronline

Master Trader
Jul 11, 2012
92
1
64
Finally. I got it to work!

It took me like 2 hours to make it work. First, I changed the order types, then I had to switch up TP to SL, first nothing would make the EA send the tickets, and then finally it did.

Thank you so much Enivid!!!!!!!!!!!!!!!!!!!!!!