Keeping the internal workings of an EA on an external server - page 3

 

decidence wrote >>

Gordon: The whole point is I'm not looking to make other people money for free. If someone has a great idea or a manual system that works really well automated and can't do it themselves they can either, learn how to program it, pay someone to develop it and retain the rights to the property (if the intention is to sell it then they would want all this extra work done anyway which is another reason for me to learn), or get someone to do it for free under the guise of not re-distributing it. I don't trust people not to re-distribute my free work. What am I getting out of doing this work for free? If someone provides a great system that works well then I can trade it myself and even moreso wouldn't want it being sold all over the internet.

I see... Well, I wish u the best of luck, although IMHO this is not going to work. Not because it's not technologically feasable (it is, and this discussion is pretty interesting). Simply because it's FREE. You r going to be swamped by people with half-baked, unprofitable and uncodable 'ideas'... After all it's free! What have they got to lose.

 
decidence:

Yea that last point you make "examines the MACD values and returns a simple yes/no response" is the part I have no idea about.

You're talking about an incredibly simple piece of code. In this example scenario where the EA knows that a cross has occurred and just wants validation, it could assemble the current and previous MACD histogram values, plus the histogram value on a higher timeframe, and send it to the server using a URL such as the following:


http://www.yourserver.com/page.php?currentmacdtf1=0.21&previousmacdtf1=-0.31&currentmacdtf2=0.36


I don't use PHP, but the code in something like Microsoft ASP to process and validate the signal is then as follows. The EA would check the response it got from the server, going long/short as appropriate. (The following code checks that a basic cross has occurred as well as checking the higher timeframe, but to minimise latency issues and avoid swamping the server in traffic you ought to do the basic signal processing in the EA, and only contact the server for extra validation.)


<%
	dim vCurrentMacdTF1, vPreviousMacdTF1, vCurrentMacdTF2
	vCurrentMacdTF1 = CDbl(request("currentmacdtf1"))
	vPreviousMacdTF1 = CDbl(request("previousmacdtf1"))
	vCurrentMacdTF2 = CDbl(request("currentmacdtf2"))

	if vCurrentMacdTF1 > 0 and vPreviousMacdTF1 < 0 and vCurrentMacdTF2 > 0 then
		' MACD on lower timeframe has crossed zero upwards, and higher timeframe histogram is also positive
		Response.Write "Long"
	elseif vCurrentMacdTF1 < 0 and vPreviousMacdTF1 > 0 and vCurrentMacdTF2 < 0 then
		' MACD on lower timeframe has crossed zero downwards, and higher timeframe histogram is also negative
		Response.Write "Short"
	else
		Response.Write "(No signal)"
	end if
%>


decidence wrote >>

although it may make my bandwidth provider hate me in the long term?

Interesting. Most people, including many supposedly professional developers, don't give a thought to bandwidth usage. You're starting from the exact opposite position, and being unnecessarily paranoid. Provided that the EA does the basic processing, and only uses the server fairly occasionally for signal validation, then the bandwidth usage of something like this is going to be utterly trivial. Ditto processor, memory, and disk I/O usage.

 
Your right that does look rather simple. Does MQL have some sort of listener to be ready for that response?
 
decidence:
Does MQL have some sort of listener to be ready for that response?

You don't need a "listener". Unless you want to get very fancy, you use synchronous HTTP where EA execution blocks until it gets the response from the server. Lots of example HTTP client code in this forum and the codebase. I've never used any of it personally, but, for example, the various bits of code in https://www.mql5.com/en/forum/111394 and https://www.mql5.com/ru/code/10679 look as though they'll connect to a URL and return the text of the response.

 

Thanks a lot, once again I think this thread has been super useful and I'm sure will be for a lot of people googling this type of question. I'm going to give it a try as soon as I can find some spare time.


I was actually thinking that this could be a good way to validate a user as well as the "http://www.yourserver.com/page.php?currentmacdtf1=0.21&previousmacdtf1=-0.31&currentmacdtf2=0.36" could also send a unique identification that must be validated in order to send back a valid signal.

 
decidence:

I was actually thinking that this could be a good way to validate a user as well as the "http://www.yourserver.com/page.php?currentmacdtf1=0.21&previousmacdtf1=-0.31&currentmacdtf2=0.36" could also send a unique identification that must be validated in order to send back a valid signal.

Sadly, life isn't necessarily quite that simple - depending on how paranoid you're feeling, as alluded to above (see 2010.02.23 21:47).


Your starting point is that you're concerned about people decompiling your .ex4 file. If they do this, and they know one valid set of user credentials, then they can modify your code so that it always supplies the valid credentials - e.g. a fixed account number and corresponding licence key, rather than the real AccountNumber().


The easiest way to deal with this is to check the IP address, and watch for use of the same credentials from multiple addresses within a defined period of time. I wouldn't describe this as "inaccurate" (see 2010.02.23 01:51), but it does compromise your ability to charge per account rather than per computer. A decompiled and modified EA will work on any number of accounts on the same IP address. But this check does greatly reduce the attractiveness of bothering to decompile and modify the code.


Finally, licensing systems generate support queries. The price you pay for adding any of these kinds of protection is that you'll get calls from frustrated users who have e.g. had to move their trading to a backup computer, and are finding that their EA is refusing to work.

Reason: