A trading dashboard that, by using two separate Oanda FXTrade trading accounts, provides U.S. TDesk traders the ability to use hedging in their trading strategies. This EA takes trades from TDesk and places them through the Oanda V20 API via a custom Python script. Although it does not have all of the features of Desky integrated yet, it is based on the same trade logic and shares some of the same code.
How does this work?
When a trade is triggered a file is written in the Empty4’s file folder. A separate Python script reads the file, performs the trade operation and returns a file that Empty4 can read.
What are the advantages of this EA?
- Provides traders the ability to trade any size. Trades can be as small as 1 unit. This would be the equivalent of 0.00001 within Empty4. This allows systems that trade a large number of pairs or trades to be run on a small account.
- Using 2 accounts, one for short trades and one for long trades, gives U.S. traders the ability to use a form of hedging. Since the accounts would vary in size over time, occasional rebalancing of accounts by transferring funds from one account to the other would be necessary.
- In the U.S. there are different margin requirements for each pair. This EA has the ability to automatically calculate lot sizes based on this and other variables.
- Manages data from two separate accounts
- Sends notifications via Empty4’s notification system
- Monitors TDesk and the Python script to make sure both are running. If one stops, trading activity ceases.
- Pause opening of new trades or all trading activity using the “AutoTrading” button.
- Can use a set lot size or let the EA auto calculate lot sizes based on U.S. margin requirements using a risk based or max margin utilization method.
- Can pause or manually trade any pair.
- Displays current and past system messages on the dash
- Basket trading
- Grid trading
- Recovery
- Dollop lot sizes
- Anything else I forgot to add
Is this usable on Oanda accounts outside the U.S.?
I have not verified this, but if the V20 API is the same I see no reason why it wouldn’t work.
This EA / Python Script / etc. does not work.
RTFM! I have spent a lot of time working on the attached manual. Follow everything exactly and it will work. I have used this setup on multiple computers and currently run it on an AWS cloud server without issue. If it doesn’t work for you, you have likely skipped a step or didn’t follow the instructions. Please check, and check again before asking for help.
Can you add ‘X’ feature?
I will gladly accept feature requests. If they are useful to myself and others and are possible to code without doing a complete rewrite, I would be happy to add them. Time permitting.
The Dashboard display is squished
You are likely on a high-resolution display. This is caused by Windows 10 scaling. Here is how to make it display correctly:
- Right click the Empty4 icon on your desktop
- Choose Properties
- Select the Compatibility tab
- Press “Change high DPI settings”
- Select “Override high DPI scaling behavior.”
- Change the dropdown to “System”
- Select “OK”
- Select “Apply”
- Close Property window and restart Empty4.
The EA simply passes the message to Empty4’s notification system. So, if it is not working correctly the issue lies with Empty4 and cannot be fixed.
Changelog:
Version 1.01
BUG FIXED: Automatic trades were still being placed when a pair was set to manual mode
BUG FIXED: Automatic / Manual mode setting not being remembered on reload
BUG FIXED: New trades continued to be opened while AutoTrade button was not pressed
Version 1.02
BUG FIXED: Code to wait 10 seconds for TDesk was commented out
BUG FIXED: Incorrect logic when calculating time between hedge trades