Programmer wanted for reliable EA with error handling - page 2

 
explorer3333:

bearnaked,

My son looked the code and his comments to me are below. Please don't take offense about his comment, my goal is to have trust in someone like you before we start. If you don't mind, could you give him a short technical answer? I would appreciate it.

explorer


From my son:

The while loop seems to depend on the value of the "ticket" variable, which has no defined initial value and is never assigned a value (a nasty bug in C-like programs, I'm unclear whether MQL retains this deficiency). At a glance, it should be "ticket = OrderSend..." but that part seems to be left out.


Furthermore, I don't understand the reason for the following snippet in the error-handling section:

This tells me that if the order did not not go through properly (assuming it's a server error), that you will halt the program for ten seconds (during which many ticks may come in that we need to act upon), and then not attempt to send the order again (but instead break out of the loop).

The style is definitely not as bad as what I've seen (and I like that he encapsulates the order sending logic in a separate function), but if this is code that he intends to use, he needs to explain why he implemented the error handling the way he did, and why he didn't initialize or assign a value to the ticket (which stands out to me as a glaring bug).

Hi mister Explorer... no problems brother...I would do the same thing if I was to contract somebody.


Let's talk about it!


Frist: The source code is old, and your son is a good programmer, because he saw something WRONG in the code. And his think is correct.

the "ticket" variable needs the value of the OrderSend. The logic is:

var ticket RECEIVE the number of REAL ticket from ordersend function

in mql: ticket = OrderSend(...);

then, we needs to interpret the ticket code.


Second:

Sleep(10000);
//---- refresh price data
RefreshRates();
break;

This code is unnecessary. Why?

Because the "break"operator terminates the execution of the nearest nested outward "while", "for" or "switch" operator..

In the next enter in the While operator, the system will do the RefreshRates function at the begining of the structure.


the correct structure is:

while (true) 
{
   RefreshRates()
   if (order == OP_BUY)
     ticket = OrderSend()
   else
   if (order == OP_SELL)
     ticket = OrderSend()

// but we also can use in this way
// ticket = OrderSend(parameters in the function/procedure structure)
// continuing...

   if (ticket <=0)
   {
     int error=GetLastError();
     if(error==134) //---- not enough money
     {
       //throw the error code to be interpreted
       showMessageError(error);
       // there aren't reasons to continue here because we do not have enough money, then, bye
       break;
     }
     // in other way, if there is some problem (because the connection, or server is busy, or other kinds of problems) when we were sending an order to the server, then,
     // we needs to update the status and continue our tries
     // first, why is the reason for the problem? Let's know through our message handling
     showMessageError(error);
     //---- 10 seconds wait
     Sleep(10000);
     //---- refresh price data
     RefreshRates();
   }  
   else
   {
     // ok, the order was sent
     OrderSelect(ticket,SELECT_BY_TICKET);
     OrderPrint();
     // bye bye 
     break;
   }
}


It's the correct structure.

 
explorer3333:

bearnaked,

My son looked the code and his comments to me are below. Please don't take offense about his comment, my goal is to have trust in someone like you before we start. If you don't mind, could you give him a short technical answer? I would appreciate it.

explorer


From my son:

The while loop seems to depend on the value of the "ticket" variable, which has no defined initial value and is never assigned a value (a nasty bug in C-like programs, I'm unclear whether MQL retains this deficiency). At a glance, it should be "ticket = OrderSend..." but that part seems to be left out.


Furthermore, I don't understand the reason for the following snippet in the error-handling section:

This tells me that if the order did not not go through properly (assuming it's a server error), that you will halt the program for ten seconds (during which many ticks may come in that we need to act upon), and then not attempt to send the order again (but instead break out of the loop).

The style is definitely not as bad as what I've seen (and I like that he encapsulates the order sending logic in a separate function), but if this is code that he intends to use, he needs to explain why he implemented the error handling the way he did, and why he didn't initialize or assign a value to the ticket (which stands out to me as a glaring bug).

Why don't you just ask your son to fix your EA?

 
fxcourt:

Why don't you just ask your son to fix your EA?

fxcourt,

Do I REALLY have to justify, why I want to pay somebody? If you HAVE to know that is why.

My son is doing double major AND working full time and have a particularly heavy course load this quarter. He has very little time left. The program that we try to fix would pay back the $1k payment from the 1st trade, so it was decided to look for paid help rather than wait. And because there are a lot of third world countries with a lot of good programmers where $1k is still a good month salary. Now you know.


bearnaked,

We decided not pursue with you this farther based on the idea that the original sample code submitted had problem. And because of the various remarks like above that have nothing to to with solution (I got strongly beat up on another forum), I close this thread and go to Rent-A-Coder or some similar services where I don't have to justify my actions. I think in retrospect, forums are the wrong place to look for paid services.


Thanks all you comments, THIS THREAD IS CLOSED AS FAR AS MY ORIGINAL REQUEST CONCERNED.

explorer

 
explorer3333:

fxcourt,

Do I REALLY have to justify, why I want to pay somebody? If you HAVE to know that is why.

My son is doing double major AND working full time and have a particularly heavy course load this quarter. He has very little time left. The program that we try to fix would pay back the $1k payment from the 1st trade, so it was decided to look for paid help rather than wait. And because there are a lot of third world countries with a lot of good programmers where $1k is still a good month salary. Now you know.


bearnaked,

We decided not pursue with you this farther based on the idea that the original sample code submitted had problem. And because of the various remarks like above that have nothing to to with solution (I got strongly beat up on another forum), I close this thread and go to Rent-A-Coder or some similar services where I don't have to justify my actions. I think in retrospect, forums are the wrong place to look for paid services.


Thanks all you comments, THIS THREAD IS CLOSED AS FAR AS MY ORIGINAL REQUEST CONCERNED.

explorer

Ok explorer..no problem...

I thought that you were looking for the code style(and for this reason, I sent an old(really olde) code ... anyway...

Best regards,

Dan

 

"I got strongly beat up on another forum"


Explorer, I'd venture that there are quite a few of us on the forum who have built our EAs in exactly the way you describe. Many of us have modularized the functionality you require as building blocks that we frequently reuse as we compose (and I use that word on purpose) our new EAs.


Have you considered that your lack of success in engaging a programmer may be down to your attitude?


After reading your original request and your subsequent responses, my view is that you would not be someone I could work with. And, apart from family members, you may find others think along the same lines.


Now, you can either take that as constructive criticism that may help you to get the job done eventually; or you can get hot under the collar. I really don't mind, but I wish you luck in your quest.


CB

 
explorer3333:

fxcourt,

Do I REALLY have to justify, why I want to pay somebody? If you HAVE to know that is why.

My son is doing double major AND working full time and have a particularly heavy course load this quarter. He has very little time left. The program that we try to fix would pay back the $1k payment from the 1st trade, so it was decided to look for paid help rather than wait. And because there are a lot of third world countries with a lot of good programmers where $1k is still a good month salary. Now you know.


bearnaked,

We decided not pursue with you this farther based on the idea that the original sample code submitted had problem. And because of the various remarks like above that have nothing to to with solution (I got strongly beat up on another forum), I close this thread and go to Rent-A-Coder or some similar services where I don't have to justify my actions. I think in retrospect, forums are the wrong place to look for paid services.


Thanks all you comments, THIS THREAD IS CLOSED AS FAR AS MY ORIGINAL REQUEST CONCERNED.

explorer

Oh thats a shame.

Reason: