stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Desky. TDesk's trading drone.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545
Page 18 of 50
Author:  c1borg [ Thu Jan 03, 2019 5:37 am ]
Post subject:  Desky. TDesk's trading drone.

I know your always very busy :youknow: but I have a feature request :smile: is it possible to close individual pending trades when TDesk Super signal goes to FLAT. My latest experiments seem to be behaving well but I sometimes have to manually close pending signals which didnt make the grade. Obviously I can then tinker with the settings in TDesk which cause the FLAT condition to optimise things. :hi:

Edit: This might be too complex, after giving this further thought as it could effect recovery trades which I also now use. :arrrg:
Author:  SteveHopwood [ Thu Jan 03, 2019 11:11 am ]
Post subject:  Desky. TDesk's trading drone.

c1borg » Thu Jan 03, 2019 5:37 am wrote:I know your always very busy :youknow: but I have a feature request :smile: is it possible to close individual pending trades when TDesk Super signal goes to FLAT. My latest experiments seem to be behaving well but I sometimes have to manually close pending signals which didnt make the grade. Obviously I can then tinker with the settings in TDesk which cause the FLAT condition to optimise things. :hi:

Edit: This might be too complex, after giving this further thought as it could effect recovery trades which I also now use. :arrrg:
I can add it as an option.

It is complicated, because we would also want the pendings reinstating if the signal leaves FLAT again and we have market trades open.

I am taking a few really lazy days. I will look at this next week.

:xm: :rocket:
Author:  c1borg [ Thu Jan 03, 2019 12:33 pm ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Thu Jan 03, 2019 11:11 am wrote: I can add it as an option.

It is complicated, because we would also want the pendings reinstating if the signal leaves FLAT again and we have market trades open.

I am taking a few really lazy days. I will look at this next week.

:xm: :rocket:
Very good point
Author:  SteveHopwood [ Sun Jan 13, 2019 3:57 pm ]
Post subject:  Desky. TDesk's trading drone.

V 2n is inpost 1. This has the pending order deletion function requested by c1borg. From the updated user guide:
  • DeletePendingOrdersOnFlatSignal: tells Desky to delete outstanding buy/sell stop orders in the event that TDesk generates a FLAT signal. Desky will try to replace them if TDesk subsequently returns a trading signal in the direction of an open market trade. For example:
    • You have a market buy open and a grid of 5 buy stop trades.
    • TDesk returns a FLAT signal, so Desky deletes the outstanding stop orders.
    • TDesk changes again and returns a LONG signal. Desky detects the open market order and replaces the pending grid.
  • DeletePendingOrdersOnOppositeSignal: as above. I have included this in case your platform loses contact with your broker's server whilst TDesk generates an opposite-direction signal.
Treat this with suspicion folks, and do not use it on a live money account until proven on demo. It is not the simplest of code I have ever written.

Maybe bloop-spotters might care to run their peepers over it:
  • Line 155 declares the inputs.
  • Line 4471 starts the void DeletePendingOrders(string symbol) function - hard to see what I could get wrong there, but this is me we are talking about here.
  • Line 4828 starts the code block that does all the work.
:xm: :rocket:
Author:  c1borg [ Sun Jan 13, 2019 5:05 pm ]
Post subject:  Desky. TDesk's trading drone.

I've been waiting for this can't thank you enough :hi:
Author:  SteveHopwood [ Sun Jan 13, 2019 5:41 pm ]
Post subject:  Desky. TDesk's trading drone.

c1borg » Sun Jan 13, 2019 5:05 pm wrote:I've been waiting for this can't thank you enough :hi:
Hehe. Let's see if it works first. :lol:

Any bugs should be easy to squish.

:xm: :rocket:
Author:  tomele [ Sun Jan 13, 2019 5:54 pm ]
Post subject:  Desky. TDesk's trading drone.

Hi @all.

There is a new version of the module that allows communication between TDesk and Desky (TDeskSignals.mqh) here: http://www.stevehopwoodforex.com/phpBB3 ... 22#p163522. It enables Desky to now read and write the Veto Signal settings to the FXTestify database.

Please re-compile Desky with it.

Cheers
Thomas
Author:  c1borg [ Mon Jan 14, 2019 5:16 am ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Sun Jan 13, 2019 5:41 pm wrote: Hehe. Let's see if it works first. :lol:

Any bugs should be easy to squish.

:xm: :rocket:
Feedback...

Desky is opening and closing many pending orders on the same pair almost every second are you seeing this behaviour? I guess it may be that this is what TDesk is telling Desky to do, but I dont have the knowledge to investigate further for you. Otherwise if yours works I may have a bad setting, any thoughts.
Capture.PNG
Author:  SteveHopwood [ Wed Jan 16, 2019 5:20 pm ]
Post subject:  Desky. TDesk's trading drone.

V 2o is in post 1, with the fix for the immediate deletion of pending orders.

It took me a while to work out that I had put the code in the wrong place so Desky was responding to a signal belonging to a different pair.

OnTimer() had got to resemble a bit of a bowl-of-spaghetti appearance so I have rationalised. What were previously lumps of code now occupy their own function. This makes the program flow easier to follow, so simplifying adding more functionality in the future.

This might have introduced the occasional bug, but they should be easy enough to squish.

:xm: :rocket:
Author:  c1borg [ Wed Jan 16, 2019 6:20 pm ]
Post subject:  Desky. TDesk's trading drone.

Goes without saying many thanks :good: , good news is im getting some success and have been waiting for this as the icing on the cake :hi:

Edit: Early days but seems youve cracked the problem :yahoo:
All times are UTC Page 18 of 50