//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.
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.
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?
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.
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
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)
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)
/*
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.
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 » 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)
/*
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.
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.
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
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.
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.
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.
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.
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.
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