Техническое задание
Currently I trade on brokers that do not require FIFO compliance. However I must very soon switch to US brokers.
My favorite EA and very important to my portfolio, opens trades in an averaging way. One sell order audcad for 1 lot is the first trade. if the bot needs to average, it will open the second sell order on audcad for the same a1 lot amount. the EA always opens next orders of the same symbol and direction at the same size. it does not martingale or increase subsequent orders by a set multiplier.
When the audcad price begins to move the direction desired by the bot, the trades will begin closing last to first. they do not close all at once. therefore the last trade that closes is always the first to be opened. you can now see how this will not work for a FIFO broker.
NOW, the fix for this that IS ALLOWED by the broker, is say I open first audcad buy at 1 lot and then later open another audcad buy for 1.1 lots and then later open a third trade fot 1.11 lots, I can then close any of the trades int he order I chose. I can close the 1.1 buy first if i want to. or the 1.11. it does not matter. becasue the lot sizes all different this does not violate the specifics of the FIFO rules.
The freelance work I am wanting is to have a custom external filter made that works for the FX Blue personal trade copier. I have asked if this is possible to the developer and he said that people have made this in the past. he then directed me to the section on the user guide where is discusses how this can be achieved. it say the following:
You can make your own modifications to the copier using MQL code libraries in MT4/5.
Before describing the libraries, there are two important notes about re-installing the copier if you use these external filters:
If you re-run the copier's installer program, this will overwrite any changes which you have made to the custom code libraries described below. If you make changes, you should keep copies of your modified files, and re-install them into MT4/5 after you re-run the copier's setup program.
In future versions of the copier, there may be additions to the functions/hooks in the external filter libraries. When a new version of the copier is released, you may need to update your modified code with new functions which the copier expects to find in the external MQL library.
The copier has MQL code libraries called CopierSenderFilter and CopierReceiverFilter. These are used by the copier if you turn on the UseExternalFilters setting in the Advanced section of the sender and receiver options. You can modify and recompile these libraries to create your own rules for the following:
Prevent the sender copying specific trades
Prevent the receiver copying specific signals from the sender
Change how the receiver copies a trade from the sender - override the lot-sizing, swap the trade direction, change the s/l or t/p, or even change one symbol to another
Prevent trade closes in the receiver
For information on how the filters work, simply open the .mq4/.mq5 files in MT4/5's MQL\Libraries directory. You can add your own rules to these files, recompile the .ex4/.ex5 library, turn on UseExternalFilters, and then reload the copier. Please remember to take a backup of your modified files - as described above.
So to end. I wish for an external filter to be added to the receiver filter library and adds 0.01 lots to each trade in accordance to how many trades that one occurs after the first of a symbol and of the same direction. for example. trade 1 buy audcad. no chnages need to be made to the first trade. the second trade will come from the original EA at 1 lot and needs to be changed to 1.01. and so on and so forth. if it is working correctly, say there are 7 buy orders on audcad. the seventh trade should be 1.06 lots because it is the sixth trade AFTER the orignal 1 lot trade.
I have included two photos. the first is how trades are placed by the EA. they are all of the same size. when this is the case, I cannot close the last trade first.
the second photo is the result i desire. I need all the trades to be different sizes to be fifo compliant to close in an order i choose. I want them to only by different by the smallest( 0.01) amount as to not through off the balance of the system.
I wish for this to be a modification that is allowed by the developer to be made to the FX blue personal trade copier in a way that leaves all the rest of the code unaffected. if this fix is not possible, perhaps we can discuss the creation of a new copier that has this functionality.
Thanks