Trabajo finalizado
Tarea técnica
Hello,
I need someone who can develop this Pairs Trading EA, I tried to simplify the concept as much as i could, but if you need more clarifications, you are welcome to ask anytime. Thanks!
EA Rules:
EA Compares two Pairs that were pre-selected by the user:
1. P1= EA calculates the current price change percentage. (Takes the Current Price of the first Pair minus the Opening price, all divided by the Opening price, multiplied by 100)
2. P2= EA Does the Same calculations for the second pair that was chosen by the user.
3. EA calculates the difference between the two current price changes between both pairs (P1 – P2) make it absolute value so the results are always positive.
· The Entry Rule will be: If the difference is equal to or higher than a certain percentage (that will be pre-selected by the user) then EA executes the trades.
· The position sizes will be: pre-selected by the user (for example Pair X position’s size is 1 lot, and pair Y position’s size is 2 Lots)
4. The buy position will be for the pair that has the lowest price change percentage, and the sell position will be for the pair that has the highest price change percentage. (Example Pair X has moved 15% while Pair Y has moved by only 5%, so the EA will buy Pair Y with the pre-determined position size that was already selected by the user, and at the same time, the EA will sell Pair X also with the pre-determined position size that was already selected by the user).
· The Exit Rules will be: the EA will continue to calculate the price variation percentage for both pairs, until the difference between the two pairs variations is equal to a pre-determined percentage (for example: on our last example X moved 15% and Y moved 5% so the difference was 10%, and that’s what the user selected as entry trigger for the trades => 10% Difference. So, the EA Bought Y and Sold X with the position sizes that were pre-selected by the user. Now the exit rules will be also pre-selected by the user, and they are also based on the difference between the two pairs variations. The Entry Trigger was 10% so the EA started the Trades, the Exit Rules were: if the Difference is equal to 5% then Close the positions and that will be a Take Profit. (because the difference was 10% and narrowed to 5%) and if the Difference widen to for example 20% close the Trades, and that will be a stop loss because the difference has widened)
So, the User will need to pre-determine these Rules:
· Pair 1
· Pair 2
· Position Size: Pair 1 = X Lot. Pair 2 = Y Lot.
· Entry Trigger in percentage (for example: 10%. This will be the difference between the two pairs current variations)
· Exit Triggers: TP= if the difference is equal to or less than x% (for example 5%) / SL= if the difference is equal to or Greater than y% (for example: 20%)
· A checkbox for a POSSIBILITY to select a duration for the trades to be closed, for example: the user CAN check this box and determine a date for the positions to be automatically closed. Ex: 3 Days, if none of the exit rules is triggered within the 3 days, EA will close the positions as soon as the 3 days are passed.
· Another check box for how many times are the entries triggered: By default, this should be one time as long as the positions are open, once they are closed for a TP or SL, we wait until the next day and start the whole process again. However, this checkbox will allow the user to select how many times the entries can be triggered within the same day, for example let’s say the user choses 3 times, so once the entry is triggered, the EA will start trading and wait until either the TP or the SL is triggered. Then wait again for the entry to be triggered for the second time, and so on, so only one trade a time is allowed.
· Another checkbox where the user will be free to select the allowed trading period, either he leaves it as default (all day long) or chooses a custom trading period. (please make sure this doesn’t affect the other checkbox rule where we mention the duration of a trade, so for example in this rule I chose to trade from 9 AM to 2PM, and the other checkbox I set the duration at 3 days, so EA will start working from 9 AM to 2PM then it will be snoozed, so even if hit a TP or SL after that period the EA don’t do anything, until the next day at 9AM it starts the tracking of the positions again, and so ON, for 3 days (the pre-determined period) then the EA Closes the Positions no matter was the result, because it's been 3 days like mentioned on the rules)