TDesk Discussion

Post Reply
pMashMash
Posts: 7
Joined: Sun Feb 24, 2019 1:21 pm

TDesk Discussion

Post by pMashMash »

tomele » Thu Jun 13, 2019 7:52 pm wrote:Hi again Paul.
pMashMash » 13 Jun 2019, 16:58 wrote:To come back to the spread subject, my TDesk shows correct long term spread values for spread such as 1.1 or 0.7 but for all the spreads with double digit values it is showing wrong values below 1. I think the double digit part might be a good point to start investigating. I have been using TDesk for 2 months now and the spread issue has been the same for me with exotic assets having double digit spreads hence my contribution today.
By describing your observations properly, you have indeed pointed me to a problem. I will have to work on this.

Well spotted. :clap: :clap: :clap:

Cheers
Thomas
Happy to positively contribute Thomas :!!:

Cheers,
Paul
wojtek_amm
Trader
Posts: 23
Joined: Fri Jan 13, 2012 9:52 am
Location: Poland

TDesk Discussion

Post by wojtek_amm »

Hi Thomas,

There is a variable named TDTRADETIME in Global Variables.

What event (or events) in TDesk update and overwrite this variable?

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

TDesk Discussion

Post by tomele »

Hi Wojtek.

All TDTRADE... global variables hold data for trading drones and are read by TDeskSignals.mqh.

TDTRADETIME/XXXXXX/NN holds the last Super Signal change time for symbol XXXXXX. It goes into the array TDeskTimes[] provided by TDeskSignals.mqh.

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
wojtek_amm
Trader
Posts: 23
Joined: Fri Jan 13, 2012 9:52 am
Location: Poland

TDesk Discussion

Post by wojtek_amm »

tomele » Sun Jun 23, 2019 10:53 am wrote:Hi Wojtek.

All TDTRADE... global variables hold data for trading drones and are read by TDeskSignals.mqh.

TDTRADETIME/XXXXXX/NN holds the last Super Signal change time for symbol XXXXXX. It goes into the array TDeskTimes[] provided by TDeskSignals.mqh.

Cheers
Thomas
Hi,

There is also a variable TDSUPERSIGNAL in Global. TDeskSignals.mqh does not download this variable

What causes this variable to be overwritten - what event?

Are these two variables overwritten at the same time and indicate the same?

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

TDesk Discussion

Post by tomele »

Hi again.

All global variables that start with TD..., but not TDTRADE... (signals for trading drones) or TDSIG... (signals from drone indicators) are internal variables, mainly for remembering TDesk states after a crash or restart. They are not meant to be used or tampered with by other programs. I will not discuss them.

I strongly advise to only use TDesk.mqh (for sending signals to TDesk) and TDeskSignals.mqh (for reading signals from TDesk). They keep things consistent and there is no additional information that could get derived from reading global variables directly. You will rather mess up the whole system. There will be no support from my side for such problems.

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.

TDesk Discussion

Post by SteveHopwood »

tomele » Sun Jun 23, 2019 11:06 am wrote:Hi again.

All global variables that start with TD..., but not TDTRADE... (signals for trading drones) or TDSIG... (signals from drone indicators) are internal variables, mainly for remembering TDesk states after a crash or restart. They are not meant to be used or tampered with by other programs. I will not discuss them.

I strongly advise to only use TDesk.mqh (for sending signals to TDesk) and TDeskSignals.mqh (for reading signals from TDesk). They keep things consistent and there is no additional information that could get derived from reading global variables directly. You will rather mess up the whole system. There will be no support from my side for such problems.

Cheers
Thomas
:clap: :clap: :clap:

Don't over-think or over-complicate things folks. TDesk does all the work for us, so leave it to do its thingy.

: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.
wojtek_amm
Trader
Posts: 23
Joined: Fri Jan 13, 2012 9:52 am
Location: Poland

TDesk Discussion

Post by wojtek_amm »

tomele » Sun Jun 23, 2019 12:06 pm wrote:Hi again.

All global variables that start with TD..., but not TDTRADE... (signals for trading drones) or TDSIG... (signals from drone indicators) are internal variables, mainly for remembering TDesk states after a crash or restart. They are not meant to be used or tampered with by other programs. I will not discuss them.

I strongly advise to only use TDesk.mqh (for sending signals to TDesk) and TDeskSignals.mqh (for reading signals from TDesk). They keep things consistent and there is no additional information that could get derived from reading global variables directly. You will rather mess up the whole system. There will be no support from my side for such problems.

Cheers
Thomas
Hi Thomas,

I did not ask without a reason. Tdesk + Partner EA in combination in specific situations and configurations generate an incorrect purchase or sale signal.

This happens against the logic and setup of my strategy set in TDesk.

The error is difficult to see if you use many drones. You have to sit all the time and control each newly opened transaction to notice the problem.

Even on the M5 occurs only once for a dozen new open transactions or every few hours. Less inquisitive Trader can ignore such an incorrect position and take SL.

For me, this is a mistake that undermines my strategy, but someone else can say that everything is OK - that was the idea for TDesk.

I wrote an amendment to Partner EA that completely eliminates the problem.

I do not know the TDesk code so the following description of the cause of the error is just my hypothesis. For simplicity only BUY - an example simplified description.

In EA Partner, I have set: MaxSignalAgeMinutes = 3

Tdesk
1. Input only SOLO +100 - the new position opens - OK
2. The VetoSignal and the drone with ForceExit are shown closing the position - OK
3. After a few more minutes, Veto disappears - OK
3. At this point, ValueSolo has, for example, only +33.
4. At this point, SuperSignal returns from the VETO state to its previous state - that is, LONG and simultaneously updates the SuperSignal time variable in GLOBAL - an error is likely to occur here.

! Tdesk does not check if LONG is still valid. - Error

The EA partner sees the change of time in Global for SuperSignal and treats it as a new signal to open (renew) the new position - !!! wrong position, because at this moment SoloValue already has a value of only +33 and the assumption of the entry strategy is not met.

The hypothetical error is that after the disappearance of VETO SuperSignal returns to the previous status (for example LONG) without checking if it is still valid.

Perhaps this is also the case in other cases, such as blocking by SPREAD or NEWS and others?

In my strategy, I generate the VETO signal just to use ForceEXIT - in VETO and ForceEXIT I have the same Drones reported.

A simple amendment to Partner EA completely eliminates the problem.

The original TdeskSignal.mqh gets

Code: Select all

int TDeskSValues ​​[]; // Array holding the Solo Signal values
int TDeskMValues ​​[]; // Array holding the Multi Signal values
so we can use them directly in the EA Partner.

We add the following Code to the EA Partner:

Code: Select all

//1.34
extern string  gen1="----General inputs OPEN SOLO/Multi Signal first New Position----";
extern string  gen11="--------";

extern string  gen12="----Only one option can be -TRUE- SOLO or MultiAndSolo----";
extern string  gen13="----If both Option -FALSE- EA use orginal TDesk signals----";

extern bool    UseDirectSoloValueSignalEntryThreshold   = false;
extern bool    UseDirectSoloAndMultiValueSignalEntry    = false;

extern string  gen14="---- SOLO Value ----";
extern int     BuySoloValueEntryThreshold                  =  95;
extern int     SellSoloValueEntryThreshold                 = -95;

extern string  gen15="----MULTI Value ----";
extern int     UseBUYMultiSignalEntryThreshold            =  10;
extern int     UseSELLMultiSignalEntryThreshold           = -10;
//END 1.34
The original section of the position opening code

Code: Select all

void detectTradingSignal(int pairIndex, int signal)
{

   if (openTrades == 0)
   {
      buySignal = false;
      sellSignal = false;
      if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes || MaxSignalAgeMinutes == 0)
      {
         if (signal == LONG)
            buySignal = true;
         
         if (signal == SHORT)
            sellSignal = true;
            
      
      }//if (if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes))
      
   }//if (openTrades == 0)
   

}//End void detectTradingSignal(int pairIndex, int signal)
we replace

Code: Select all

//1.34 open first new position to work  Direct with SOLO/Multi Signal
void detectTradingSignal(int pairIndex, int signal )
{

   if (UseDirectSoloValueSignalEntryThreshold) 
   {
   if (openTrades == 0)
     {
      buySignal = false;
      sellSignal = false;
      if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes || MaxSignalAgeMinutes == 0)
      {
         if (TDeskSValues[pairIndex] > BuySoloValueEntryThreshold)
            buySignal = true;
         
         if (TDeskSValues[pairIndex] < SellSoloValueEntryThreshold)
            sellSignal = true;
            
      
      }//if (if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes))
      
   }//if (openTrades == 0)
  } // if (UseDirectSoloValueSignalEntryThreshold)
  
  
  
  else
  
   if (UseDirectSoloAndMultiValueSignalEntry) 
   {
   if (openTrades == 0)
     {
      buySignal = false;
      sellSignal = false;
      if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes || MaxSignalAgeMinutes == 0)
      {
         if ((TDeskSValues[pairIndex] > BuySoloValueEntryThreshold)   && (TDeskMValues[pairIndex] > UseBUYMultiSignalEntryThreshold))
            buySignal = true;
         
         if ((TDeskSValues[pairIndex] < SellSoloValueEntryThreshold)  && (TDeskMValues[pairIndex] < UseSELLMultiSignalEntryThreshold))
            sellSignal = true;
            
      
      }//if (if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes))
      
   }//if (openTrades == 0)
  } // if (UseDirectSoloAndMultiValueSignalEntry)
  
  
  else
  
  // Orginal System
  
  if (openTrades == 0)
     {
      buySignal = false;
      sellSignal = false;
      if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes || MaxSignalAgeMinutes == 0)
      {
         if (signal == LONG)
            buySignal = true;
         
         if (signal == SHORT)
            sellSignal = true;
                  
      }//if (if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes))
      
   }//if (openTrades == 0)

}//End void detectTradingSignal(int pairIndex, int signal)

//End 1.34
and that's all.

Now if we use only SOLO or MultiAndSOLO to open a new position, everything works without a problem - At least for ME

Of course, you must correlate SOLO and MULTI values ​​in Tdesk and ParterEA.

The above changes only for those users who have the same problem and understand what they are doing and why. The fact that it works with me does not mean that it will work with your strategy.


! I hope I will not get a lifetime Ban for the above entry.

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

TDesk Discussion

Post by tomele »

Hi Wojtek.
wojtek_amm » 24 Jun 2019, 11:04 wrote:The hypothetical error is that after the disappearance of VETO SuperSignal returns to the previous status (for example LONG) without checking if it is still valid.

Perhaps this is also the case in other cases, such as blocking by SPREAD or NEWS and others?
Thanks for pointing me to this problem. I will have a look into 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
wojtek_amm
Trader
Posts: 23
Joined: Fri Jan 13, 2012 9:52 am
Location: Poland

TDesk Discussion

Post by wojtek_amm »

Error
Last edited by wojtek_amm on Wed Jun 26, 2019 9:17 am, edited 1 time in total.
User avatar
tomele
Administrator
Posts: 1166
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

TDesk Discussion

Post by tomele »

wojtek_amm » 25 Jun 2019, 14:24 wrote:Hi Thomas,

In my opinion, it should be possible to choose whether TDesk Universal Drones (all 4 types) have FLAT or NONE output. For example for work withs levels.

Best Regards
Wojtek
Hi Wojtek.

Shouldn't be a problem, although I don't understand the purpose. Please elaborate.

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