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

Desky. TDesk's trading drone.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545
Page 25 of 50
Author:  SteveHopwood [ Fri Mar 08, 2019 3:43 pm ]
Post subject:  Desky. TDesk's trading drone.

I fixed the negative swap thingy - 3b in post 1.

Easy DIY:
Do a search for, "//OnlyTradePositiveSwap filter". Insert this directly underneath:
TradeLong = true;
TradeShort = true;

Do a search for, "if (UseZeljko && !BalancedPair(symbol, OP_BUY) ) return(false);". Insert this directly underneath:
if (!TradeLong) return(false);


Do a search for, "if (UseZeljko && !BalancedPair(symbol, OP_SELL) ) return(false);". Insert this directly underneath:
if (!TradeShort) return(false);

:xm: :rocket:
Author:  kwchau [ Fri Mar 08, 2019 4:15 pm ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Fri Mar 08, 2019 11:43 pm wrote:I fixed the negative swap thingy - 3b in post 1.

Easy DIY:
Do a search for, "//OnlyTradePositiveSwap filter". Insert this directly underneath:
TradeLong = true;
TradeShort = true;

Do a search for, "if (UseZeljko && !BalancedPair(symbol, OP_BUY) ) return(false);". Insert this directly underneath:
if (!TradeLong) return(false);


Do a search for, "if (UseZeljko && !BalancedPair(symbol, OP_SELL) ) return(false);". Insert this directly underneath:
if (!TradeShort) return(false);

:xm: :rocket:
thank you so much!
Author:  Tebis [ Fri Mar 08, 2019 4:20 pm ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » 32 minutes ago wrote:I fixed the negative swap thingy - 3b in post 1.
Hi Steve,
fyi: I am testing the swap function with SPB-3 since Jan 14th.
It works pretty good except with "AUDNZD". If both direction "long/short" has negative swap, the EA opens the trades.
Author:  SteveHopwood [ Fri Mar 08, 2019 4:37 pm ]
Post subject:  Desky. TDesk's trading drone.

The DIY fix isn't quite correct - fixed again in 3b.

You need to undo the first step. Go to, "//OnlyTradePositiveSwap filter" and remove the two lines of code you inserted underneath.

Scroll to the top of the function and you will see they are already there. I was preparing to use the swap filter but then forgot to do anything with it.

:D :rocket:
Author:  Ehrenmat [ Sat Mar 09, 2019 4:37 pm ]
Post subject:  Desky. TDesk's trading drone.

Hey Steve,

I have a request concerning Desky. Is it possible to add an option to delete a grid and/or pending trades after a predefined time? This could be useful when a Super Signal isn't fresh or on its way to become FLAT. In this case, a pending order would get unnecessarily activated, which leads to an avoidable drawdown.

What do you think? Would this be useful?

Thanks for your effort and enjoy your weekend!

Cheers,

Mat

:hi:
Author:  SteveHopwood [ Sat Mar 09, 2019 5:17 pm ]
Post subject:  Desky. TDesk's trading drone.

Ehrenmat » Sat Mar 09, 2019 4:37 pm wrote:Hey Steve,

I have a request concerning Desky. Is it possible to add an option to delete a grid and/or pending trades after a predefined time? This could be useful when a Super Signal isn't fresh or on its way to become FLAT. In this case, a pending order would gets unnecessarily activated, which leads to an avoidable drawdown.

What do you think? Would this be useful?

Thanks for your effort and enjoy your weekend!

Cheers,

Mat

:hi:
I can add an expiry time so the pendings will delete themselves.

:xm: :rocket:
Author:  Ehrenmat [ Sat Mar 09, 2019 8:15 pm ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Today, 19:17 wrote:
I can add an expiry time so the pendings will delete themselves.

:xm: :rocket:

That would be most awesome! :yahoo:

Thanks for replying and have a nice evening!

Cheers,

Mat

:hi:
Author:  SteveHopwood [ Sat Mar 09, 2019 9:18 pm ]
Post subject:  Desky. TDesk's trading drone.

Ehrenmat » Sat Mar 09, 2019 8:15 pm wrote:
SteveHopwood » Today, 19:17 wrote:
I can add an expiry time so the pendings will delete themselves.

:xm: :rocket:

That would be most awesome! :yahoo:

Thanks for replying and have a nice evening!

Cheers,

Mat

:hi:
The whole point of Desky is so that people can devise trading strategies and then test them quickly and easily without needing a purpose-built EA.

A strategy that depends on stop orders could easily mean that the orders remain in place for a limited amount of time. It makes sense to me to accommodate this kind of request. You are not asking me to add a moving average filter, after all. :lol:

OK, so it also means that Desky gradually becomes harder to use but hey; TDesk/Desky is not a combo designed for dimwits unable to think for themselves. I am getting better at releasing updates with the latest feature disabled, so the worst that can happen is that he stubbornly refuses to trade unless the latest lazy dimwit works out that it needs to read the UG.

So I will add this feature with pleasure. Besides, http://www.stevehopwoodforex.com/phpBB3 ... 58#p166558 is the latest where you prove you are not merely a bottom-feeder.

:xm: :rocket:
Author:  SteveHopwood [ Sun Mar 10, 2019 11:53 am ]
Post subject:  Desky. TDesk's trading drone.

V 3c is in post 1. This has the option to send an expiry time with pending orders both when responding to a TDesk initial signal and when sending a grid of stop orders. Your inputs are the number of minutes you will allow an unfilled pending to remain: PendingOrderExpiryMinutes and GridOrderExpiryMinutes.

I noticed that the order of inputs in the, "Trading styles" section was confusing, so I have rearranged them. It should be clearer now which inputs apply to immediate market trades and which to pending orders.

DIY:
Do a search for: extern string tst="---- Trading styles ----";

Copy this over the existing block:

Code: Select all

extern string  tst="---- Trading styles ----";
//Send a market trade as soon as there is a signal
extern bool    SendImmediateMarketTrade=true;
extern string  mtr="-- Multiple market trades --";
//This allows the user to send trades following each new signal, up to a selected maximum
extern int     MaxOpenTradesAllowed=5;
extern int     MinDistanceBetweenTradesPips=30;
extern string  pen="---- Pending trades ----";
extern bool    SendPendingTrades=false;
extern PendingTradeTypes TypeOfPendingTrade=Stop_order_only;
extern int     DistanceFromMarketPips=20;
//An expiry time for the stop order
extern int     PendingOrderExpiryMinutes=0;
extern bool    DeletePendingOrderWhenSignalChanges=false;
////////////////////////////////////////////////////////////////////////////////////////
double         DistanceFromMarket=0;
double         MinimumDistanceBetweenTrades=0;
////////////////////////////////////////////////////////////////////////////////////////
That will rearrange the inputs and add the new one.

Do a search for: extern int DistanceBetweenTradesPips

Insert this immediately below:

Code: Select all

//An expiry time for grid stop orders
extern int     GridOrderExpiryMinutes=0;
Do a search for this comment: //if (SendPendingTrades) expiry = TimeCurrent() + (PendingExpiryMinutes * 60);

Delete the comment and replace it with this code block:

Code: Select all

   /*Pending orders can be sent with an expiry time. Desky knows that
   the trade is triggered by a fresh TDesk signal if grid trading
   is disabled. He will send the appropriate expiry if grid trading
   is enabled.
   */
   
   //Is this a stop/limit order
   if (type > 1)
   {
      //Responding to an original signal
      if (!UseGridTrading)
      {
         if (PendingOrderExpiryMinutes > 0)
            expiry = TimeCurrent() + (PendingOrderExpiryMinutes * 60);
      }//if (!UseGridTrading)
      
      //Grid orders
      if (UseGridTrading)
      {
         if (GridOrderExpiryMinutes > 0)
            expiry = TimeCurrent() + (GridOrderExpiryMinutes * 60);
      }//if (UseGridTrading)
      
   }//if (type > 1)
   
This is nearly at the top of the bool SendSingleTrade(string symbol,int type,string comment,double lotsize,double price,double stop,double take) function. I have also added an extra call to GetBasics() right at the top, merely as an extra precaution:

Code: Select all

   GetBasics(symbol);
:xm: :rocket:
Author:  SteveHopwood [ Sun Mar 10, 2019 11:56 am ]
Post subject:  Desky. TDesk's trading drone.

Just remembered - I have changed MaxTradesAllowed to MaxOpenTradesAllowed, so just follow the error messages to make the changes when you compile the code. A global search and replace will also work here.

:xm: :rocket:
All times are UTC Page 25 of 50