Signal Transmitter/Receiver! - page 10

 

Ea

Hi,

i want a simply Trade Copy EA with fast processing with illimited account slave (500ms)

with 4 or 5 digits broker

with Lot multiplier function

SL and TP modification

THANKS

 

The logic here in the thread is fundamentally flawed

Hello,

So, I don't want to be throwing rocks at the thread but I will say that all of the operations being contemplated with regards to cloning trade instances and instructions are not really properly handled via the method discussed in the thread.

The exception is if you want to make trades from one instance of MT appear in another instance of MT _on_the_same_system_only_.

Any other reaching out to have the trades from one computer to another are really only handled properly when coded at the server level. By trying to make one client side instance of MT speak to another, several problems will occur for sure - it is only a matter of time before they show themselves. The contraption actuality would never be able to be a production stable mechanism. If you want to build that, do so at the server level, or be doomed to fail.

Don't want to rain on your parade but think that as an FX Systems Programmer I should encourage you all not to spin your wheels on this approach.

Peace Out

 

checked

works

 

I know it's kind of late in the game, but do you (fxtrader625) think you could modify TradeSwitch.dll so there are two separate instances of it? For example, TradeSwitch_1.dll and TradeSwitch_2.dll? What I'm trying to do is communicate between two EA's on separate accounts, which actually does work, except the communication is only one way. So, I figured by creating two separate instances, and the variables to reflect this (e.g., FlushSignal_1, SendSignal_1 and ReceiveSignal_1), then it should be able to communicate both ways.

What do you think? Thanks.

 
ecTrade:
I know it's kind of late in the game, but do you (fxtrader625) think you could modify TradeSwitch.dll so there are two separate instances of it? For example, TradeSwitch_1.dll and TradeSwitch_2.dll? What I'm trying to do is communicate between two EA's on separate accounts, which actually does work, except the communication is only one way. So, I figured by creating two separate instances, and the variables to reflect this (e.g., FlushSignal_1, SendSignal_1 and ReceiveSignal_1), then it should be able to communicate both ways. What do you think? Thanks.

Why should I modify this DLL if you know you can write signals to different folders in registry? With same DLL you can have both instances communicating each others.

Instance1:

SendSignal("RegistryFolderA", "Text1Value");

string Text2 = ReceiveSignal("RegistryFolderB");

Instance2:

SendSignal("RegistryFolderB", "Text2Value");

string Text1 = ReceiveSignal("RegistryFolderA");

Regards,

Jeff

 
fxtrader625:
Why should I modify this DLL if you know you can write signals to different folders in registry?

No, I don't know that you can do this. Thus far I haven't been able to do so. And no, I don't know all there is to know about DLL's. In fact very little. I just suggested this because it seemed to make sense. Neither did it seem like it would be that difficult to do but, I could be mistaken. I just know it didn't work when I tried to change the values to something else.

With same DLL you can have both instances communicating each others.

Hey, that would be great!

Instance1:

SendSignal("RegistryFolderA", "Text1Value");

string Text2 = ReceiveSignal("RegistryFolderB");

Instance2:

SendSignal("RegistryFolderB", "Text2Value");

string Text1 = ReceiveSignal("RegistryFolderA");

Regards,

Jeff

So, if I add this code exactly as shown (except for "Instance1:" and "Instance2:") it should work? And where do you add it and, do you add it to both EA's? (i.e., TestSignalTransmitter.mq4 and TestSignalReceiver.mq4).

Hey, thanks for taking the time to reply.

Oh, I tried sending you an email earlier (because you hadn't posted to this thread in over a year), but they wouldn't allow me to because that was only my second post above.

Thanks again!

 

For each communication way you need to define a different name, i.e. from instance 1 to instance 2 "ComPath12", and from instance 2 to instance 1 "ComPath21". So for instance1 we write SignalTransmitter:

#import "TradeSwitch.dll"

int FlushSignal(string Name);

int SendSignal(string Name, string Value);

string ReceiveSignal(string Name);

#import

int start()

{

SendSignal("ComPath12", "Text from instance 1 to instance 2.");

Comment("Signal data sent to Registry.");

// See signal data in HKEY_CURRENT_USER\Software\TradeSwitch\Signals registry

return(0);

}

[/CODE]

For instance 2, we also write SignalTransmitter, but replace "ComPath12" by "ComPath21", it must be a different folder name in the registry.

#import "TradeSwitch.dll"

int FlushSignal(string Name);

int SendSignal(string Name, string Value);

string ReceiveSignal(string Name);

#import

int start()

{

SendSignal("ComPath21", "Text from instance 2 to instance 1.");

Comment("Signal data sent to Registry.");

// See signal data in HKEY_CURRENT_USER\Software\TradeSwitch\Signals registry

return(0);

}

[/CODE]

To receive signals in each instance from other instance, we write SignalReceiver and define corresponding ComPath values:

Instance 1 receiving signal from Instance 2

[CODE]

#import "TradeSwitch.dll"

int FlushSignal(string Name);

int SendSignal(string Name, string Value);

string ReceiveSignal(string Name);

#import

int start()

{

string message = ReceiveSignal("ComPath21");

if (StringLen(message) > 0)

{

Comment("Signal received: ", message);

}

return(0);

}

For instance 2 receiving signal from instance 1, the same, but replace "ComPath21" by "ComPath12".

[CODE]

#import "TradeSwitch.dll"

int FlushSignal(string Name);

int SendSignal(string Name, string Value);

string ReceiveSignal(string Name);

#import

int start()

{

string message = ReceiveSignal("ComPath12");

if (StringLen(message) > 0)

{

Comment("Signal received: ", message);

}

return(0);

}

Hope this helps

Regards,

Jeff

 

Yeah, I figured there would probably be four instances of it, as it requires four EA's, two in each account (currently) to get it to talk both ways. But, you definitely know more about it than I do!

I will definitely try this out and get back to you.

So, are you still accepting donations via PayPal?

Thanks again!

 
ecTrade:
Yeah, I figured there would probably be four instances of it, as it requires four EA's, two in each account (currently) to get it to talk both ways. But, you definitely know more about it than I do!

I will definitely try this out and get back to you.

So, are you still accepting donations via PayPal?

Thanks again!

Or you can better even try with this, for instance 1:

#import "TradeSwitch.dll"

int FlushSignal(string Name);

int SendSignal(string Name, string Value);

string ReceiveSignal(string Name);

#import

int start()

{

SendSignal("ComPath12", "Text from instance 1 to instance 2.");

string message = ReceiveSignal("ComPath21");

if (StringLen(message) > 0)

{

Comment("Signal received: ", message);

}

// See signal data in HKEY_CURRENT_USER\Software\TradeSwitch\Signals registry

return(0);

}

[/CODE]

For instance 2:

[CODE]

#import "TradeSwitch.dll"

int FlushSignal(string Name);

int SendSignal(string Name, string Value);

string ReceiveSignal(string Name);

#import

int start()

{

SendSignal("ComPath21", "Text from instance 2 to instance 1.");

string message = ReceiveSignal("ComPath12");

if (StringLen(message) > 0)

{

Comment("Signal received: ", message);

}

// See signal data in HKEY_CURRENT_USER\Software\TradeSwitch\Signals registry

return(0);

}

My paypal is: paypal@forexampletrades.com

Thanks and regards,

Jeff

 

Yes, in fact I had already tried something like this, except I couldn't get it to work or, talk both ways. But I didn't think it was because I tried incorporating them on the same EA.

Also, what about the FlushSignal() function in the init() of Transmitter EA? Is that no longer required?

int init()

{

// Flush internal signal data

FlushSignal(Symbol());

Comment("Flushed internal data.");

return(0);

}

Thanks!

Reason: