I Want To Learn About Bots

Not bots for spam or doing anything annoying but just bots in general.
I’ve been subjected to learning about their ways through bitcoin exchanges, and I’ve learned about bots using machine learning and GA.

What I want to know about is simple bots and simple rules and how I can make the rules.
Anyone want to tell me about them?

How about IRC Bots? Sure there is plenty of documentation of programming them. Know some people who have a few running on their IRC channel, some of which you can pretty much have conversation with (Crabby has been believed to be a real person by n00bs as will respond any time his name is mentioned) and another with a learn functionality so will pick up phrases and their replies, eg you say “morning” and it might say “top of the morning to you” or somesuch.

Well, a bot is just a program plus some database. The program collects data (e.g. as a web-client communicating with web-servers), stores it, and proceeds on the basis of the data. The way the program proceeds is calculated by some algorithm processing the collected data. New facts will be collected data, while rules may be (derived from) collected data as well as simply hard wired part of an algorithm (or as parameters to the algorithm of course). The rules may be fixed, but the algorithm may also involve evaluation, user input, pseudo-randomness, etc. in order to adjust the rules.
But actually a bot need not necessarily be ‘learning’ anything at all. Sometimes a bot may be just interacting with some other software in a dumb way, but typically much faster than a human user, or 24/7 over and over again.

Well, to do such things, of course learn to code first. Maybe have a look at the Prolog system to see how a bot might work: In its pure form Prolog code is all facts and rules, and there’s the system’s algorithm trying to prove or falsify an input statement based on those given facts and rules. Then have a look at Machine Learning literature as you already mentioned yourself.

Nice one guys.

Being on the other side of them, I’ve been studying the way they move.

Mainly watching what they do here:
^ works only in chrome and safari I believe

this guy shared a lot of information in this reddit:

this is his trading bot:

ask botb

ask botb

I don’t know bots, but I know that often, AI is based on probability or statistics.

In the field of probability, I think you should view bayesian theory (what is used sometimes to detect spams).
In the field of statistics, you should view logistic models or decisions trees, which permit to modelize the probabilities of occurence of events from the result of some explanatory variables.

Nb: these two types of statistic models are supervised, you have to dispose of a database with observations of these variables and the result of the event.

There is also neural networks, but can’t say a word about it !

You’re talking about Bitcoin which I have discovered on the Renoise forum by the way, maybe you should have a look at linear regression models to try to predict the futur rate with some explanatory variables (that you have to find yourself).

At least a lot of people call the use of probability or statistics AI nowadays. ;)
I once worked for a company in a team with two more fellow computational linguists. We felt constantly embarrassed by the fact that we were fully aware of using simply statistics and probabilities, but the marketing guys made us call it AI. They never heard of psychological approaches, like building real knowledge about the world, etc…

Anyway, whatever it’s called, counting and calculating methods you mentioned work pretty good in a lot of places.

Now looking at trading, I think this is none of those places!
I tried to do something like that with Forex, but I think it’s easier to do a correct one year weather forcast. It’s simply chaotic, and whatever algorithm I tested, no matter how well tuned to tons of past data, it always failed to be better than guessing in the long run.
I think for stuff like that you have to analyze online news for almost everything except the sports corner. Maybe even that. :lol:

So, as long as you’re not able to convince people to buy your trading software, it’s probably just a waste of time to work on such a thing.

If you still want to do automatic trading, Katz, McCormick: The encyclopedia of trading strategies isn’t too hard to read I think.

The thing about artificial neural nets is that they’re actually pretty simple by design, it’s creating a suitable “cost function” and training them that is more complex.

An ANN is basically several layers of interconnected nodes, sometimes with links to feedback information from the output layer back to the input one. You can use as many “hidden” layers as you want between input and output (more=more potential behavioral complexity, I think):

Any data you put into the input layer is multiplied by a weighting at each of the nodes, and as you can see there ^ connections themselves can be given weightings as well. The network is programmed to have the ability to alter the weightings at each of the nodes.

So far, so good, then comes the tricky part. You have to give the network a specific task to solve, and cost function based on that task. The cost function describes how close to the optimal solution any given solution is, so this makes ANNs slightly unsuitable for things like chat bots I think. What is an optimal reply to this thread?? They are probably more suited to things like data analysis.

The network can analyse a set of training data, using the cost function to work out how far away the output is from the optimal output, and then adjust the weights at each of the nodes to reduce the search space/move closer to the optimal solution. Once the network can produce the “right” (optimal/closest to cost 0) output from any given input in the training data, you can set it to work on real data :) The behavior should be the same, provided you used a broadly representative training set. With enough input/output nodes and layers you can theoretically train it up to do pretty much anything, although the more complex the problems, the harder it will be to write the cost function and more data/longer will be needed to train. The reason why they also might not be suitable for trading; there’s no real way of telling from past stock market data what will be a good bet in the future, too many factors come into play.

There’s obviously a lot more theory to different types of network/learning algorithms etc but thats a quick tour. I could even show you some basic examples in java if you like, but it’s been a while, so please somebody correct me if I’m wrong about any of the above!

@101010 It looks like that trading program you posted is using a Genetic Algorithm. Something completely different I’m also happy to ramble ignorantly about!!

I mainly just want one to play with.
Not one using GA but one that only works according to simple rules I give it, I mainly just want to learn how to make rules.
I understand concepts quite easily, but syntax and rules elude me.

I don’t know if I get you right, what do you mean by rules exactly? It seems to me you think about rules like something ominous and complicated, while in their basic form they are a pretty simple thing IMHO.

A very common way (C/C++, Java, Perl, etc etc) of formulating rules is simply an if-statement in your code along these lines:

if (someStatement) {  

In Prolog rules look a bit different (and actually are different), but you will get the idea:

brother(X,Y) :- male(X), sibling(X,Y).