Oanda TDesk Drone - Artificial Hedging for U.S. Traders

User avatar
tomele
Administrator
Posts: 1166
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Oanda TDesk Drone - Hedging for U.S. Traders

Post by tomele »

Exactly.

You are a brilliant co-genius.

:party: :party: :party:

Cheers
Thomas
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Oanda TDesk Drone - Hedging for U.S. Traders

Post by SteveHopwood »

tomele » Sun Dec 23, 2018 5:11 pm wrote:Exactly.

You are a brilliant co-genius.

:party: :party: :party:

Cheers
Thomas
I love watching co-genius' at work. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

Anything I can do to facilitate you two here, just sing out. It will be done.

It has long been a source of grief to me that so much of what happens here at SHF is denied to our friends in the US. Fantastic to see that you might be overcoming this.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
mcbusrider
Trader
Posts: 23
Joined: Sun Mar 15, 2015 4:37 pm

Oanda TDesk Drone - Hedging for U.S. Traders

Post by mcbusrider »

Great work!

For a trade copier using OandaPyV20, maybe consider running T-desk on an Oanda practice account, then use a Python script to make a list of all open trades on the practice account.

This way, you can run any EA on Empty4 and the 1000 unit minimum trade size doesn't matter - it's on demo.

The Oanda V20 Rest API lets you use the same library on practice and trade accounts, just change the "environment" variable to "live", add the live account info and you're good to go.

So once you have the list of open trades/orders on the practice account, change login details to the live account, get the list of live trades/orders, then compare what's open on the practice account with what's open on the trade account, closing the differences and setting new trades as necessary, resizing as appropriate.

Run the script either in a "While True:" loop, or as a cron job.

You can cycle through a list of accounts (for accountID in accountList:) if you need to get/set trades on multiple practice/live accounts.

Sorry if any of this content or these ideas are duplicate, just a few ideas for you to play with.
Jonah
Trader
Posts: 46
Joined: Sat May 11, 2013 4:13 pm
Location: Las Vegas

Oanda TDesk Drone - Hedging for U.S. Traders

Post by Jonah »

Found and fixed a few problems. New version uploaded. Here are the changes:

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
-- Lonnie.

"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime." (Muhammad Waseem)
Jonah
Trader
Posts: 46
Joined: Sat May 11, 2013 4:13 pm
Location: Las Vegas

Oanda TDesk Drone - Hedging for U.S. Traders

Post by Jonah »

mcbusrider » Sun Dec 23, 2018 12:45 pm wrote:Great work!

For a trade copier using OandaPyV20, maybe consider running T-desk on an Oanda practice account, then use a Python script to make a list of all open trades on the practice account.

This way, you can run any EA on Empty4 and the 1000 unit minimum trade size doesn't matter - it's on demo.

The Oanda V20 Rest API lets you use the same library on practice and trade accounts, just change the "environment" variable to "live", add the live account info and you're good to go.

So once you have the list of open trades/orders on the practice account, change login details to the live account, get the list of live trades/orders, then compare what's open on the practice account with what's open on the trade account, closing the differences and setting new trades as necessary, resizing as appropriate.

Run the script either in a "While True:" loop, or as a cron job.

You can cycle through a list of accounts (for accountID in accountList:) if you need to get/set trades on multiple practice/live accounts.

Sorry if any of this content or these ideas are duplicate, just a few ideas for you to play with.
Thanks for all of the great ideas!

Right now I am mapping out how the EA should look and what data and features it should have. I will keep all of these in mind as I progress.
-- Lonnie.

"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime." (Muhammad Waseem)
Jonah
Trader
Posts: 46
Joined: Sat May 11, 2013 4:13 pm
Location: Las Vegas

Oanda TDesk Drone - Hedging for U.S. Traders

Post by Jonah »

tomele » Sun Dec 23, 2018 8:40 am wrote:Given all this,

wouldn't an universal trade copier Empty4 Demo --> Oanda V20 API be the ultimate tool for trading with order sizes that perfectly fit our postulate #1 of "Never risk money you can't afford to lose"?

:) :) :)

Merry christmas
Thomas
I have this about 60% complete. Still have to do some testing and make it presentable. Turned out to be relatively easy and would have went a lot quicker if I actually knew Python :lol: . Learning as I go. Anyway, just letting it be known that this is being worked on. Hoping to have it complete by the weekend.

Merry Christmas, everyone!
-- Lonnie.

"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime." (Muhammad Waseem)
User avatar
tomele
Administrator
Posts: 1166
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Oanda TDesk Drone - Hedging for U.S. Traders

Post by tomele »

Merry X-mas, Lonnie. Take it easy.

:party: :party: :party: :party:

Cheers
Thomas
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Oanda TDesk Drone - Artificial Hedging for U.S. Traders

Post by SteveHopwood »

Lonnie has been in touch with me about where to post his latest so I have a bit of an understanding of where he is in developing his trade copier.

I shall open a new sub-forum for him once he is ready to publish.

Lonnie has a busy couple of weeks coming up, so time to possess your souls in patience, folks. His trade copier will happen; just not immediately.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
cozybooks
Trader
Posts: 299
Joined: Wed Mar 27, 2013 1:33 am

Oanda TDesk Drone - Artificial Hedging for U.S. Traders

Post by cozybooks »

Oh, Lonnie,

We have been waiting so very, very long. For something of this magnitude, we can all dream away while waiting as much longer as it takes.

Our best to you in your undertaking! You've had the vision to take on what the rest of us have only been dreaming about.

:smile: :clap: :D
Jonah
Trader
Posts: 46
Joined: Sat May 11, 2013 4:13 pm
Location: Las Vegas

Oanda TDesk Drone - Artificial Hedging for U.S. Traders

Post by Jonah »

cozybooks » Fri Dec 28, 2018 4:26 pm wrote:Oh, Lonnie,

We have been waiting so very, very long. For something of this magnitude, we can all dream away while waiting as much longer as it takes.

Our best to you in your undertaking! You've had the vision to take on what the rest of us have only been dreaming about.

:smile: :clap: :D
Below is the current state of the copier.

Currently if there is open Empty4 trades with a specified magic number and not a corresponding Oanda trade open it opens one on the correct account, either short or long. If there are any open Oanda trades and not a corresponding Empty4 trade it closes the Oanda trade. The size of the Oanda trade is based on a user-defined percentage of the Empty4 trade size. There are a few minor bugs to work out with the logic but it is working and I have had it running for 48 hours without fail.

The dashboard component of it is about 75% complete. Just need to finish the FXtrade side of the display. It displays account info from both Oanda accounts. Trade sizes can be displayed in either lots or units and are easily changed between them. Data is shown for the whole position or individual trades and includes trade ID and other info from both Empty4 and Oanda. Oanda does intraday financing rather than a daily rollover, so the dash will also display up to the minute financing info and reduce/add that to the shown profit/loss.

One problem that will need to be address is that Oanda demo accounts do not allow hedging. Not sure if a US resident can sign up for a demo account for another country. Perhaps using another broker that does allow hedging on demo accounts can be used. Not sure how different the price data displayed would be though. Have to test.

I anticipate being able to release this sometime next week. Any other features that it should have?

Here is how it looks right now.
TradeCopierWIP1.gif
You do not have the required permissions to view the files attached to this post.
-- Lonnie.

"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime." (Muhammad Waseem)
Post Reply

Return to “TDesk: A Thomas Special. The greatest trading tool ever.”