This is a simple EA for Metatrader 4. The EA should function as following:
1. Able to analyze total long positions and total short positions in lot size.
2. Able to calculate the lot size differences between total long and short postions.
3. Able to execute an order so that it makes the lot size differences equal to zero.
4. A statistical table on screen is needed for an overview of total lot size, total long position lot size, total short position lot size.
Example: The EA is attached to G/U chart. And the G/U has now 7 long positions and 3 short positions of 0.01 lot.
Total Long Position = 7 x 0.01 = 0.07
Total Short Position = 3 x 0.01 = 0.03
Difference = 0.07 - 0.03 = 0.04 lot in Long Position
So now that EA will execute a long position of 0.04 lot immediately regardless of anything.
The purpose of the EA is to make the sum of total lot size = zero.
As soon as there is a difference in the SUM lot size, the EA will execute a position to fill in the space.
This is a very simple task, you are welcome to bid for the best price.
I just realized a mistake in the example.
*So now that EA will execute a long position of 0.04 lot immediately regardless of anything.
It should be : The EA will execute a SHORT position of 0.04 lot.