Question

I attempted to create my own small program to post my trades to IRC. I had trouble finishing the program.

Then I found this program which essentially accomplishes what I'm trying to do. There are two problems: The first problem is, I just want a simple program that will post my buys, sells, shorts and covers to IRC using mIRC's DDE because I want to post the trades in the same format as the other traders.

The second problem is, the MT4 EA doesn't seem to be doing anything. It doesn't connect to IRC. The MT4 experts and journal tabs show that the EA is working properly. I've entered valid information for the server, channel and nick. I've disabled my firewall. I'm able to otherwise connect to server port 6667 with IRC clients. Can someone steer me in the right direction? Or perhaps tell me what's wrong with the code?

EDIT: I've noticed a [handshake error: 0] and [connect error: 0] in the Expert tab in MT4

A copy of the full MT4 EA script is at the bottom of this page [down arrow]: http://sites.google.com/site/prof7bit/irc_signal/experimental-new-version

Was it helpful?

Solution

The script works fine, it's a bit too bloated for me and it's lacking a small feature I need so I'll infuse my own version of it into it and clean it up.

The problem was the server. I don't know why the connection wasn't being made, but I tried the script on a different server and it connected and posted my trade, impressively quick.

This opens up other options. Because I can't connect to the other server, I can send commands to mIRC which can, in turn, handle what I need done through an internal script. I'd rather not do that, so I hope I can find out why the other server isn't acknowledging or allowing my connection.

EDIT:

I answered my own question here.

Winsock - Why isn't ZNC (and IRC bouncer) accepting my winsock connection?

I tried my suggestion to programmatically connect to mirc directly and post the trades, that way presented too many problems to solve and it was too slow for any practical use. I never got around to writing a dll for mirc, which might have been much faster in execution. If you still want to do something like this, I did it using an automated programming python library called pywinauto.

I post my trades using the script above, but I do it through ZNC bouncer. That way, ZNC does all of the authorization for me. I only have to authenticate with ZNC.

OTHER TIPS

Have you seen this part of the script?

/**
* this will be called by start()
* every minute. The server won't 
* send us pings then. (at least 
* the unreal ircd at ircforex behaves 
* this way). So we dont need to
* handle any incoming messages at all!
*/
void keepAlive(){
   static int last_time;
   int error;
   if (TimeCurrent() - last_time > 60){
          // send an empty line to the server. This will keep pings away.
      sendLine("");
      error = WSAGetLastError();
      last_time = TimeCurrent();
      if (error != 0){
         // we were disconnected, so reconnect.
         ircconnect();
         message("reconnect after timeout.");
         messageSummary();
      }
   }
}

Thats probably where your problem is...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top