stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

TradeMonitor
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3883
Page 1 of 1
Author:  renexxxx [ Fri Oct 17, 2014 6:42 am ]
Post subject:  TradeMonitor

FOR THE CODERS ....

TradeMonitor is a little EA that needs to be loaded on one chart and broadcasts events to other charts if a certain trade event occurs. Particularly, it notices new trades being opened, open trades being closed and pending trades being created, filled or deleted. Once such event occurs, it broadcasts the (custom) event to all the other charts, that in turn should listen and implement an event handler. I have added a little example listener, for the coders to adapt for their own use.

This code can be used, for instance, if one has two pending orders, a BUY STOP and a SELL STOP and one wants to cancel the other order if one of the two is filled.

Since Empty4 does not provide these trade events natively, the TradeMonitor code needs to be polling the trade status information. As it stands, the TradeMonitor polls every 5 seconds. This frequency can be increased or decreased as needed.

I hope that this code is useful for someone.
Author:  Dozer [ Mon Oct 20, 2014 2:12 pm ]
Post subject:  TradeMonitor

This is some very clever coding. Nice use of the message queue and the Chart events.

Thanks for sharing. :clap:

Dozer
All times are UTC Page 1 of 1