Desky. TDesk's trading drone.

Post Reply
taipan
Trader
Posts: 355
Joined: Sat Feb 16, 2013 11:27 am

Desky. TDesk's trading drone.

Post by taipan »

SteveHopwood » Wed Sep 25, 2019 11:00 pm wrote:
I am thrashing around in the dark here. It is just like the ole days. :arrrg: :arrrg: :arrrg:

I have added a bit more code, in hope rather than faith. Post 1 as usual.

I have added some code to: void canWeSendTrades(string symbol, int pairIndex, int signal)

Scroll down to: getBasics(symbol); Insert this just above:

Code: Select all

   //Just in case a buy/sell signal has been left when it should have been cancelled
   //and the signal has changed to untradable.
   if (signal == FLAT || signal == NONE)
      return;
 
I have added an extra check to the line of code I added earlier. Do a search for: if (!DeletePendingOrdersOnFlatSignal || signal != FLAT)

Edit to include an extra check:
if (!DeletePendingOrdersOnFlatSignal || (signal != FLAT && signal != NONE))

No idea if it will work.

:xm: :rocket:

Hi Steve,
After upated with the latest Desky, the problems still happened but not that frequent anymore. I can live with that as long as the expert log does not occurred so freqent that will not causing the GP Demo got deleted.

Thanks for the bug hunting.

taipan
User avatar
Sojourner
Trader
Posts: 105
Joined: Fri Apr 27, 2012 7:36 pm

Desky. TDesk's trading drone.

Post by Sojourner »

The closure is a 2 pass process, closing the market orders first and then deleting stop/limit orders. Sing out if this does not work.

Does your problem apply to the, "Close all trades this pair only script.mq4" script as well?

:xm: :rocket:
Hi Steve and thank you for your work.
I will try it and get back to you when I have to use the script again. I'm running 8 MT4s with various TDesk thingys on my computer and I'm letting the suggested configurations do their thing and I must confess that this TDESK thing is WAAAAYYY over my head for now so I'm afraid to 'interfere' with the bots by closing trades. It's also dragging on resources and I've had a computer lockup so far so I'm kind of being careful. I certainly will let you know how it works when I use the scripts again. I have used it on a spare Empty4 but now it's got a TDesk on it too, LOL. I must confess I'm like a kid in a candy store with this thing.
I haven't used the 'this pair only' script yet at all so I'll give that a whirl too when the opportunity presents itself. Again thanks for opening up this thing to the average joe out in trading land. We need to put the designer in a locked room with all sharp objects removed to make sure he can update the expirations, lol.
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Desky. TDesk's trading drone.

Post by tomele »

Sojourner » 26 Sep 2019, 23:22 wrote:We need to put the designer in a locked room with all sharp objects removed to make sure he can update the expirations.
First you should be absolutely sure that he will surrender to this kind of torture.
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: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

taipan » Thu Sep 26, 2019 1:18 pm wrote:
Hi Steve,
After upated with the latest Desky, the problems still happened but not that frequent anymore. I can live with that as long as the expert log does not occurred so freqent that will not causing the GP Demo got deleted.

Thanks for the bug hunting.

taipan
I am still trying. Post 1, as usual.

OR:

Go to: void fillTheGap(string symbol)

Add an extra parameter thus:
void fillTheGap(string symbol, int signal)

Add this to the top of the function:

Code: Select all

   /*
   LUC was proving to be a sodding nightmare when I coded this next snippet.
   DeletePendingOrdersOnFlatSignal is deleting stop/limit orders as soon as
   they are being sent and I have no idea why. This code snippet is me thrashing
   around in the dark, trying to fix this.
   */
   if (signal != LONG)
      if (signal != SHORT)
         return;
Press F7 to compile and follow the resulting error message to: fillTheGap(symbol);

Replace that line of code with: fillTheGap(symbol, signal);

Cross your fingers.

: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. pianodoodler@hotmail.com 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.
taipan
Trader
Posts: 355
Joined: Sat Feb 16, 2013 11:27 am

Desky. TDesk's trading drone.

Post by taipan »

SteveHopwood » Sun Sep 29, 2019 9:01 pm wrote:
taipan » Thu Sep 26, 2019 1:18 pm wrote:
Hi Steve,
After upated with the latest Desky, the problems still happened but not that frequent anymore. I can live with that as long as the expert log does not occurred so freqent that will not causing the GP Demo got deleted.

Thanks for the bug hunting.

taipan
I am still trying. Post 1, as usual.

OR:

Go to: void fillTheGap(string symbol)

Add an extra parameter thus:
void fillTheGap(string symbol, int signal)

Add this to the top of the function:

Code: Select all

   /*
   LUC was proving to be a sodding nightmare when I coded this next snippet.
   DeletePendingOrdersOnFlatSignal is deleting stop/limit orders as soon as
   they are being sent and I have no idea why. This code snippet is me thrashing
   around in the dark, trying to fix this.
   */
   if (signal != LONG)
      if (signal != SHORT)
         return;
Press F7 to compile and follow the resulting error message to: fillTheGap(symbol);

Replace that line of code with: fillTheGap(symbol, signal);

Cross your fingers.

:xm: :rocket:
Hi Steve,

Thanks for trying the debugging, still not working, same as before but not so frequent anymore. I have to turned off the Pending orders for it to normalize.

taipan
User avatar
c1borg
Trader
Posts: 456
Joined: Sun Aug 14, 2016 5:09 pm

Desky. TDesk's trading drone.

Post by c1borg »

Hi all,

I would like to try an Individual Basket Max Cash Loss, which means if one of the pairs basket of trades equals a preset cash loss we close the basket.

So for example GBPUSD has 3 open trades which reach a target of -$50 and we close the 3 trades for a $50 loss.

Not sure if this is currently possible or a feature request, having read the effing manual :youknow: , I cant seem to find it :smile:

Many thanks in advance
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

V 3v is in post 1.

3v fixes the fault described at http://www.stevehopwoodforex.com/phpBB3 ... 52#p168952. The fault will not have disturbed many of you.

If you fancy a quick DIY, go to:void fillTheGap(string symbol, int signal)

Scroll down to: sendTrade = true;
Insert this snippet immediately above that line of code:

Code: Select all

         //Using ATR to calculate the distance between trades
         if (UseAtrForGrid)
         {
            double GridAtrVal = getAtr(symbol, GridAtrTimeFrame, GridAtrPeriod, 1);
            GridAtrVal*= factor;
            distanceBetweenTrades = NormalizeDouble(GridAtrVal / GridAtrDivisor, 0);
         }//if (UseAtrForGrid)
This was in the buy stop trade block. Scroll down again to the same line of code but in the sell stop block and insert the same code snippet.

: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. pianodoodler@hotmail.com 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
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Desky. TDesk's trading drone.

Post by SteveHopwood »

V 3w is in post 1.

Ehrenmat pm'd me earlier with a fix for a bloop in the counter-trend scalping code that was preventing sells - one of my usual copy-paste-didn't-edit-properly bloops.

Mat also added a potentially useful feature to make Desky wait for a reversal before reacting to a LONG/SHORT trading signal. From the updated user guide, in the 'Trading styles' inputs section:
  • Trading only after a reversal: this is a brilliant idea added by Ehrenmat. Thganks Mat. The idea is to wait for x candles to go in the 'wrong direction' after TDesk generates a LONG or SHORT signal i.e. falling candles following a LONG and rising candles following a SHORT. This is another example of the 'buy low, sell high' principle of trading espoused elsewhere by Peaky. This is applied to all trades including grid trades. The inputs are:
    • AllTradesWaitForAReversal: turns this feature on/off. Note it is off by default.
    • ReversalTimeFrame: this is the time frame for the candles to reverse.
    • NoOfCandlesInReversal: the number of candles that must have travelled in the 'wrong' direction before Desky will send a trade. For example:
      • You have this feature turned on, with ReversalTimeFrame = the H1 and NoOfCandlesInReversal = 2.
      • TDesk generates a LONG signal, so Desky waits for the market to fall two candles on the H1 before sending a trade.
Thanks Mat. Wonderful stuff. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

You can DIY by doing downloding 3v and doing a match whole word and case search for: //stop. This will take you to everything that needs adding to your version. There are:
  • some inputs
  • a couple of lines of display code
  • an entire function to copy/paste (bool waitForCandleReversal(string direction, string symbol) )
  • many additions to void canWeSendTrades(string symbol, int pairIndex, int signal), so the easiest thing to do is to copy Mat's function over the top of the existing one
  • the bloop fix in bool haveEnoughcandlesReversed(string direction, string symbol)
  • ignore the one in void fillTheGap(string symbol, int signal) - I left out an upper case letter in the comment so there is nothing to edit
By the by folks, I have uploaded a new version of the Nuclear Option script after I noticed it was not responding to a MagicNumber=-1 input. There was a line of code I forgot to add.

: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. pianodoodler@hotmail.com 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
Ehrenmat
Trader
Posts: 89
Joined: Thu Jul 26, 2018 7:08 am

Desky. TDesk's trading drone.

Post by Ehrenmat »

SteveHopwood » Yesterday, 19:06 wrote:V 3w is in post 1.

Ehrenmat pm'd me earlier with a fix for a bloop in the counter-trend scalping code that was preventing sells - one of my usual copy-paste-didn't-edit-properly bloops.

Mat also added a potentially useful feature to make Desky wait for a reversal before reacting to a LONG/SHORT trading signal. From the updated user guide, in the 'Trading styles' inputs section:

Thanks Mat. Wonderful stuff. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:

You can DIY by doing downloding 3v and doing a match whole word and case search for: //stop. This will take you to everything that needs adding to your version. There are:
  • some inputs
  • a couple of lines of display code
  • an entire function to copy/paste (bool waitForCandleReversal(string direction, string symbol) )
  • many additions to void canWeSendTrades(string symbol, int pairIndex, int signal), so the easiest thing to do is to copy Mat's function over the top of the existing one
  • the bloop fix in bool haveEnoughcandlesReversed(string direction, string symbol)
  • ignore the one in void fillTheGap(string symbol, int signal) - I left out an upper case letter in the comment so there is nothing to edit
By the by folks, I have uploaded a new version of the Nuclear Option script after I noticed it was not responding to a MagicNumber=-1 input. There was a line of code I forgot to add.

:xm: :rocket:

Thank you very much, Steve :)

As I tested this feature for about one week with considerable advantage to the basic strategy, I want to share my experience with Desky's behaviour:

Having entry signals on H4 (i.e. SS H4), one H1 candle in the "wrong" direction is mostly enough when combining this addon with SendImmediateMarkeTrades and a MinimumDistanceBetweenTradesPips of 15. Depending on your max trades per pair, you receive a grid of trades with lower initial DD and a lower DD overall.

We will need to test it out more thoroughly, but it really seems to be beneficiary, independent of the underlying strategy.

Cheers,

Mat

:hi:
Remember: A few hours of trial and error can save you minutes of looking at the README
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Desky. TDesk's trading drone.

Post by tomele »

Hey Matthias.

Great basic research you are doing here. I am eager to see a complete setup as soon as you are happy with it.

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
Post Reply

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