Trabalho concluído
Termos de Referência
Hi everyone,
I want to trade on Correlation between two CFDs. As far as I know An expert can not calculate differences between two charts because they work only on one chart. (If it is possible let me know I can change the logic of the EA). That is why TWO EA will work at the same time, one EA will be working on every CFD. Let's explain it with an example. Let's say first CFD is A and Second is B.
To calculate correlated difference between two CFDs EA will open Buy order for CFD A and SELL order for CFD B. (Lots may vary sometimes I can select 0.01k for CFD A and 0.02k for CFD B it should be changeable from settings page). This opened orders will be our difference calculation tool. They will stay open all the time and I will call them PIVOT OPEN ORDERS. We never touch them until we stop the EA.
Every day on a specific time (Selectable from settings page) Ea will start to calculate Pivot Open Orders total profit or loss according to opened first orders at the beggining and If this open orders profit or loss passes a certain threshold (Again selectable from settings page) EA will create orders.
Example, Let's say Time selected as 14:00, Correlation Difference threshold selected as 10 usd. In the beginning when we started the EA , We opened Pivot orders like BUY for CFD A and SELL for CFD B. Let's say total profit or loss of Pivot opened orders at the time 14.00 is +15 USD. After this time EAs will wait for 10 dollars difference like +5 USD or +25 USD. If total amount of opened orders profit decreases to +5 USD then EAs will create same orders like the beginning. ( Buy order for CFD A and SELL order for CFD B). If total amount of opened orders profit increases to +25 USD. Then EAs will create opposite orders like SELL order for CFD A and BUY order for CFD B. This was the open order logic.
Eas will work like grid so according to above example every 10 dollar difference of first opened PIVOT OPEN ORDERS EAs will create the same orders with same lot. This number of grid levels should be selectable from settings page.(If we select 5 for example for this example if profit of +15 (Pivot open orders) starts to increase at levels +25 USD +35 USD +45USD +55USD +65USD at every level EAs will create SELL order for CFD A and BUY order for CFD B.
To close the orders If opened orders cross a certain threshold of profit (Selected from settings page EX: 20 usd) then When total of opened orders is 20 USD (Except our Pivot orders they should not count as profit or loss) EA will close opened orders EXCEPT OUR PIVOT OPEN ORDERS they will stay open all the time to get a pivot point to calculate correlation.
To close the orders also there will be a loss close type. If total of this opened orders cross a certain number (Selectable from settings page like 80 USD) Then if the open orders total reaches the - 80 USD (Except our Pivot orders they should not count as profit or loss) of losses then EA will also close the opened orders. Again EXCEPT OUR PIVOT OPEN ORDERS.
To close the orders If this profit or loss numbers are not reached until 23.00 EA will close orders anyway.(Again except our Pivot Open Orders).
If you have any questions let me know I can give more examples and screenshots. Thank you all.
I wish you a Great Day.
Mert