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

Desky. TDesk's trading drone.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545
Page 20 of 50
Author:  cptcherry [ Tue Jan 29, 2019 8:33 am ]
Post subject:  Desky. TDesk's trading drone.

Thanks for fixing the bug Steve, c1borgs addition, i thought was really helpful.
amazing work on Desky!! :yahoo: :yahoo: :clap: :clap:
Lots of pips since implementing. Just need to keep track of the profitability of each variation I am currently running.
Author:  SteveHopwood [ Tue Jan 29, 2019 4:30 pm ]
Post subject:  Desky. TDesk's trading drone.

Folks, this is nothing to do with Desky. Have a read of Jem's latest post at http://www.stevehopwoodforex.com/phpBB3 ... 39#p165939

:xm: :rocket:
Author:  c1borg [ Wed Jan 30, 2019 8:39 pm ]
Post subject:  Desky. TDesk's trading drone.

Bit of feedback on ver q....

Working brilliantly so far :smile:
Capture2.png
but may have found a bug. I have this situation
Capture.PNG
With this setting
Capture1.png
The 2 pending orders with FLAT signals dont seem to be deleted is this the correct behaviour?
Author:  SteveHopwood [ Wed Jan 30, 2019 9:32 pm ]
Post subject:  Desky. TDesk's trading drone.

c1borg » Wed Jan 30, 2019 8:39 pm wrote: The 2 pending orders with FLAT signals dont seem to be deleted is this the correct behaviour?
Probably. Don't really know. Not had the same position.

:xm: :rocket:
Author:  c1borg [ Thu Jan 31, 2019 5:03 am ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Wed Jan 30, 2019 9:32 pm wrote:
c1borg » Wed Jan 30, 2019 8:39 pm wrote: The 2 pending orders with FLAT signals dont seem to be deleted is this the correct behaviour?
Probably. Don't really know. Not had the same position.

:xm: :rocket:
Curious as it has now decided to delete some pending trades :good: I will keep an eye on things but very happy many thanks again :hi:
Author:  SteveHopwood [ Wed Feb 06, 2019 6:01 pm ]
Post subject:  Desky. TDesk's trading drone.

V 2r is in post 1, in response to c1borg's post in the Confused thread: http://www.stevehopwoodforex.com/phpBB3 ... 32#p166032

The code that deletes pending orders on a FLAT signal was underneath the code that detects a NONE signal and stops Desky from doing anything at all. We do not want that, so I have moved the code higher.

Easy DIY. Do a search for, "//Code to delete pending orders when the signal goes FLAT,". Delete the block of code.

Then do a search for, " //Lot size based on account size" and insert the code block you just deleted, just above the lot calculation block. Your code will look like this:

Code: Select all

      //Code to delete pending orders when the signal goes FLAT,
      //then replace them when the signal turns back to trading.
      DoPendingOrdersDeletionAndReplacement(symbol, signal);
      
      //Lot size based on account size
I will work out an 'orphaned' pending trade function to pick up on anything else like this.

:xm: :rocket:
Author:  c1borg [ Wed Feb 06, 2019 6:44 pm ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Wed Feb 06, 2019 6:01 pm wrote:V 2r is in post 1, in response to c1borg's post in the Confused thread: http://www.stevehopwoodforex.com/phpBB3 ... 32#p166032

The code that deletes pending orders on a FLAT signal was underneath the code that detects a NONE signal and stops Desky from doing anything at all. We do not want that, so I have moved the code higher.

Easy DIY. Do a search for, "//Code to delete pending orders when the signal goes FLAT,". Delete the block of code.

Then do a search for, " //Lot size based on account size" and insert the code block you just deleted, just above the lot calculation block. Your code will look like this:

Code: Select all

      //Code to delete pending orders when the signal goes FLAT,
      //then replace them when the signal turns back to trading.
      DoPendingOrdersDeletionAndReplacement(symbol, signal);
      
      //Lot size based on account size
I will work out an 'orphaned' pending trade function to pick up on anything else like this.

:xm: :rocket:
Many thanks again :good: will report back.
Author:  c1borg [ Wed Feb 06, 2019 7:15 pm ]
Post subject:  Desky. TDesk's trading drone.

Ok just watching this trade live it placed a pending SELL trade bang on time as far as I could see, then went to a FLAT signal and it hasnt deleted as yet. Could it be my chart is set for 1H and it needs to wait for a new bar or should it delete immediately?
Capture.PNG
Edit:
Looks like the SELL trade was made at the start of the new H1 bar now FLAT 15m old and still there
Edit:
Next bar just begun still FLAT and pending trade refuses to budge
Capture1.png
Author:  SteveHopwood [ Fri Feb 08, 2019 12:14 pm ]
Post subject:  Desky. TDesk's trading drone.

V 2s is in post 1.

c1borg solved the conundrum of the non-deleted pending orders. He spotted that I had coded only the grid orders, not those generated when SendPendingTrades is enabled.

Reading another programmers code is hard even when you are used to doing so. Managing it when you are a fledgling coder is just plain bloody marvelous, so well done and thanks, c1borg. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

I decided to separate the pending order deletion decisions, so watch your inputs if you download 2s:
  • DeletePendingOrdersOnFlatSignal and DeletePendingOrdersOnOppositeSignal are now in the grid section.
  • DeletePendingOrderWhenSignalChanges has replaced them in the "Trading styles"; orders will be deleted if the spread widens above acceptable levels.
DIYers, do a search for, "//Pending order deletion following a FLAT or opposite direction signal." Copy this code into your clipboard:

Code: Select all

//Pending order deletion following a FLAT or opposite direction signal.
extern bool    DeletePendingOrdersOnFlatSignal=true;
extern bool    DeletePendingOrdersOnOppositeSignal=true;
Scroll down to the grid section and insert the code you copied just above "extern bool UseAtrForGrid=false;"

Scroll back to the code you copied, delete it and insert,
extern bool DeletePendingOrderWhenSignalChanges=false;

Then find "void DoPendingOrdersDeletionAndReplacement(string symbol, int signal)", go to the end of the function and insert this:

Code: Select all

   //Stop/limit orders sent when SendPendingTrades is enabled
   if (SendPendingTrades)
      if (DeletePendingOrderWhenSignalChanges)
         if (PendingTradesTotal > 0)
         {
            //Long pendings
            if (BuyStopOpen || SellStopOpen)
               if (signal != LONG)
               {
                  DeletePendingOrders(symbol);
                  CountOpenTrades(symbol);         
               }//if (signal != LONG)
               
            //Short pendings
            if (SellStopOpen || SellStopOpen)
               if (signal != SHORT)
               {
                  DeletePendingOrders(symbol);
                  CountOpenTrades(symbol);         
               }//if (signal != LONG)
               
         }//if (PendingTradesTotal > 0)
   
:xm: :rocket:
Author:  wallywonka [ Mon Feb 11, 2019 3:55 am ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Fri Feb 08, 2019 12:14 pm wrote:V 2s is in post 1.

c1borg solved the conundrum of the non-deleted pending orders. He spotted that I had coded only the grid orders, not those generated when SendPendingTrades is enabled.
Hi Steve, I'm using grid orders and it doesn't appear to be deleting pending orders on opposite or flat signals, both are enabled.
All times are UTC Page 20 of 50