leecallen35 / Trade-copier-Oa2Dx

Python program to copy trades from Oanda to DxTrade
5 stars 2 forks source link

Trade-copier-Oa2Dx

Python program to copy trades from Oanda to DxTrade

Oanda: utilizes the Oanda V20 streaming interface to receive notifications of opens & closes, uses API calls to get information (account balances, open positions).

DxTrade: utilizes the DxTrade API to open & close trades, get account balance, get open positions.

Important notes:

To do:

Usage:

  1. Edit dxtrade_api.py to reflect your broker and account credentials - these 2 lines:
    self.base_url = "https://dxtrade.ftmo.com/dxsca-web/"
    ftmo_conn = DXT("accountnumber", "password")
  2. Run dxtrade_api.py, it should create 3 trades, then delete 1 of them, then delete all of them, giving you a list of open positions after each activity.
  3. Edit Trade-copier-oa2dx.py to reflect your Oanda and DxTrade account credentials - these lines:
    
    # set this to 1 for Live or 0 for Demo
    live_or_practice = 0

if live_or_practice:

live

oanda_env = "live"
oanda_account_id = "123-456-7890123-456"
oanda_access_token = "0123456789abcdef0123456789abcdef-0123456789abcdef0123456789abcdef"
ftmo_account_id = "123456789"
ftmo_password = "password"

else:

demo

oanda_env = "practice"
oanda_account_id = "123-456-7890123-456"
oanda_access_token = "0123456789abcdef0123456789abcdef-0123456789abcdef0123456789abcdef"
ftmo_account_id = "123456789"
ftmo_password = "*password"

5. Run it in demo (practice) mode, test it extensively.