MT4 Programming Requests

 

Greetings,

I would like to request assistance locating or programming a very simple indicator that will plot average price ((bid-ask)/2) from Broker A terminal and display it as a horizontal line on any chart on Broker B Terminal.

Also, if possible, a text written above the line identifying the broker that the price was retrieved from would be great.

Thanks,

Pip

 
mladen:
You could try using named pips, but you will have to use timer and you are probably going to have problems synchronizing it (it is a time - you can miss ticks)

I actually did something similar when testing pipes, in addition it had suppression of price offset.

The pipes are asynchronous, because the indicator cannot block the pipe and ticks do not get lost but rather queued.

From the measurement, the timer shortest schedule interval is 15-16 ms (unlike Sleep(), which works with 1ms delay easily), the pipe delay randomly spikes to 100ms, though mostly it is close to 1ms.

The indicator displays the (Ask+Bid)/2 from both charts (with applied offset) on the client chart round the current candle.

pipereceiver.ex4

pipereceiver.mq4

pipeserver.ex4

pipeserver.mq4

Files:
 
Ovo:
I actually did something similar when testing pipes, in addition it had suppression of price offset.

The pipes are asynchronous, because the indicator cannot block the pipe and ticks do not get lost but rather queued.

From the measurement, the timer shortest schedule interval is 15-16 ms (unlike Sleep(), which works with 1ms delay easily), the pipe delay randomly spikes to 100ms, though mostly it is close to 1ms.

The indicator displays the (Ask+Bid)/2 from both charts (with applied offset) on the client chart round the current candle.

pipereceiver.ex4

pipereceiver.mq4

pipeserver.ex4

pipeserver.mq4

Did not know about queuing the ticks in this case. Good to know. Thanks ____________________

PS: running the timer at 15-16 milliseconds is what metatrader tells is the fastest it can run (without freezing the terminal). Knowing them, it is better to add some more time to that "minimal" timer settings - just in case ...

 
Pip:
Greetings,

I would like to request assistance locating or programming a very simple indicator that will plot average price ((bid-ask)/2) from Broker A terminal and display it as a horizontal line on any chart on Broker B Terminal.

Also, if possible, a text written above the line identifying the broker that the price was retrieved from would be great.

Thanks,

Pip

You could try using named pipes, but you will have to use timer and you are probably going to have problems synchronizing it (it is a time - you can miss ticks)

 

Since I can not use the sources (mqj files missing) - where can I find more information on named pipes used in mql?

 
apprentice coder:
Since I can not use the sources (mqj files missing) - where can I find more information on named pipes used in mql?

You can check this : Named Pipes for MT4 @ Forex Factory (there are some changes required - changing ansi functions with their unicode equivalents) but all in all, it is a good starting point

 
mladen:
You can check this : Named Pipes for MT4 @ Forex Factory (there are some changes required - changing ansi functions with their unicode equivalents) but all in all, it is a good starting point

Thanks

 
Ovo:
I actually did something similar when testing pipes, in addition it had suppression of price offset.

The pipes are asynchronous, because the indicator cannot block the pipe and ticks do not get lost but rather queued.

From the measurement, the timer shortest schedule interval is 15-16 ms (unlike Sleep(), which works with 1ms delay easily), the pipe delay randomly spikes to 100ms, though mostly it is close to 1ms.

The indicator displays the (Ask+Bid)/2 from both charts (with applied offset) on the client chart round the current candle.

pipereceiver.ex4

pipereceiver.mq4

pipeserver.ex4

pipeserver.mq4

Thank you very much for the assistance Ovo, would you by any chance have the two mqh needed for the indicator to work?

#include

#include

I visited the FF thread but could not find exact match for the files needed, only found something similar.

Cheers,

Pip

 

Mr. Pip....What are you up to?....sounds mysterious..............................

 
Pip:
Thank you very much for the assistance Ovo, would you by any chance have the two mqh needed for the indicator to work?

#include

#include

I visited the FF thread but could not find exact match for the files needed, only found something similar.

Cheers,

Pip

It is a chain of files, in fact you would need my entire framework to make it compilable (which cost me some effort).

If you needed to adopt this sample, just ask, I am willing to perform minor updates.

 
Ovo:
It is a chain of files, in fact you would need my entire framework to make it compilable (which cost me some effort). If you needed to adopt this sample, just ask, I am willing to perform minor updates.

Hi Ovo,

Thank you for the offer; I am not technically inclined such as yourself and thus any help would be greatly appreciated. I do need a solution to bring over the Bid/Ask or the average price from Broker A onto the chart of Broker B. If there is a way for you to update the files provided earlier that would be great, if not; then I appreciate the intent to help.

Cheers,

Pip

Reason: