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

Desky. TDesk's trading drone.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545
Page 16 of 50
Author:  c1borg [ Mon Dec 10, 2018 4:31 pm ]
Post subject:  Desky. TDesk's trading drone.

Amazing how fast you work many thanks :hi:
Author:  theforexedge [ Mon Dec 10, 2018 5:32 pm ]
Post subject:  Desky. TDesk's trading drone.

Hi Steve
b) remove the pending trade(s) if the signal goes flat or reverses as an option.
I've just really started to play with Desky and if the delete pending trades on FLAT can be added with max number of open trades it would really help me mirror my live trading strategy for testing!

I also have a useful No Supply / demand indicator i've hacked that I think would be useful to add to the indicators pool, but it needs converting to MTF and thats a bit beyond my coding skills :lol:

As always thanks for the dedication of all the coders and contributors here at SHFX helping traders like me realise that trading for a living is possible :smile:

Jason
Author:  SteveHopwood [ Mon Dec 10, 2018 8:32 pm ]
Post subject:  Desky. TDesk's trading drone.

theforexedge » Mon Dec 10, 2018 5:32 pm wrote:Hi Steve
b) remove the pending trade(s) if the signal goes flat or reverses as an option.
I've just really started to play with Desky and if the delete pending trades on FLAT can be added with max number of open trades it would really help me mirror my live trading strategy for testing!
This is one of those requested options that emerge with use. I will add it.

:xm: :rocket:
Author:  c1borg [ Tue Dec 11, 2018 8:48 am ]
Post subject:  Desky. TDesk's trading drone.

Feedback.... Pending trades now working perfectly :smile:
Author:  SteveHopwood [ Tue Dec 11, 2018 9:45 am ]
Post subject:  Desky. TDesk's trading drone.

c1borg » Tue Dec 11, 2018 8:48 am wrote:Feedback.... Pending trades now working perfectly :smile:
Thanks.

I just read a pm from Mauro stating the opposite.

What is your MaxTradesAllowed input value?

:xm: :rocket:
Author:  c1borg [ Tue Dec 11, 2018 11:10 am ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Tue Dec 11, 2018 9:45 am wrote: Thanks.

I just read a pm from Mauro stating the opposite.

What is your MaxTradesAllowed input value?

:xm: :rocket:
Max trades is set to 1
Author:  SteveHopwood [ Tue Dec 11, 2018 11:22 am ]
Post subject:  Desky. TDesk's trading drone.

c1borg » Tue Dec 11, 2018 11:10 am wrote:
SteveHopwood » Tue Dec 11, 2018 9:45 am wrote: Thanks.

I just read a pm from Mauro stating the opposite.

What is your MaxTradesAllowed input value?

:xm: :rocket:
Max trades is set to 1
Thanks. It looks as though it is a combo of MaxTradesAllowed being > 1 and grid trading being enabled that causes the problem.

So folks, if you are grid trading make sure that MaxTradesAllowed = 1. I never intended gridding and multi-trading fresh TDesk signals to mix, so I will enforce the separation in the next release.

:xm: :rocket:
Author:  SteveHopwood [ Wed Dec 12, 2018 11:33 am ]
Post subject:  Desky. TDesk's trading drone.

V 2m is in post 1. Most of you can ignore this update.

I have added the candle reversal-based scalping method so that we have both methods to play with. This is the only trading decision that Desky makes independently of TDesk and I am not going to add any more.

Tim wrote to me last night saying that there is a bug in the incremental lot sizing, so I have tried to fix this. Get in touch again please Tim, if the fix does not work.

For those of you who fancy updating without re-downloading, here is what to do:
Do a search for, "extern string sep6a="================================================================";"

Copy this over the top of the existing code:

Code: Select all

extern string  sep6a="================================================================";
//This offers the opportunity to scalp a few pips in the opposite direction
//when an existing trade signal turns to FLAT, on a short timeframe. No idea if it will prove helpful.
extern string  ctsc="---- Counter trend scalping ----";
extern bool    UseCTS=true;
//This is the original CTS feature
extern bool    UseIndependentCTS=false;
//This uses a TDesk FLAT signal when there are already open trades
extern bool    UseTdeskFlatSignal=true;
extern ENUM_TIMEFRAMES CtsTimeFrame=PERIOD_M5;
//The number of candles that must have reversed.
extern int     NoOfCandlesInReversal=2;
extern string  CtsTradeComment="Cts scalp";
extern int     CtsTakeProfitPips=20;
extern int     CtsStopLossPips=10;
////////////////////////////////////////////////////////////////////////////////////////
double         CtsTakeProfit=0, CtsStopLoss=0;
datetime       CtsCandleOpenTime[];
int            CtsOpenTrades=0;
////////////////////////////////////////////////////////////////////////////////////////
Replace the void DoCtsTrading(string symbol, int signal) function with this:

Code: Select all

void DoCtsTrading(string symbol, int signal)
{

   //Handles counter-trend scalping.
   
   //Desky will send a cts scalp trade if there are trades open
   //and TDesk has generated a FLAT signal.
   
   if (CtsOpenTrades > 0)
      return;//Already have an open scalp trade

   
   double take = 0, stop = 0;
   GetBasics(symbol);
   
   //Scalping using the number of ltf candles going against the trade
   if (UseIndependentCTS)
   {
      //Send a scalping sell on a buy signal
      if (signal == LONG)
      {
         //TDesk as generated a LONG signal, so have enough candles
         //fallen to generate a scalp trade short.
         if (HaveEnoughCandlesReversed(down) )
         {
            take = NormalizeDouble(bid - (CtsTakeProfit / factor), digits);
            stop = NormalizeDouble(bid + (CtsStopLoss / factor), digits);
            
            SendSingleTrade(symbol, OP_SELL, CtsTradeComment, Lot, bid, stop, take);
         }//if (HaveEnoughCandlesReversed(down) )
         
      }//if (signal == LONG)
      
      //Send a scalping buy on a sell signal
      if (signal == SHORT)
      {
         //TDesk as generated a LONG signal, so have enough candles
         //fallen to generate a scalp trade short.
         if (HaveEnoughCandlesReversed(up) )
         {
            take = NormalizeDouble(ask + (CtsTakeProfit / factor), digits);
            stop = NormalizeDouble(ask - (CtsStopLoss / factor), digits);
            
            SendSingleTrade(symbol, OP_BUY, CtsTradeComment, Lot, ask, stop, take);
         }//if (HaveEnoughCandlesReversed(down) )
         
      }//if (signal == SHORT)
         
   
   }//if (UseIndependentCTS)
   
   
   //Scalping using TDesk FLAT sognal
   if (UseTdeskFlatSignal)
   {
      if (signal != FLAT)
         return;
      //Send a scalping sell
      if (BuyOpen)
      {
         //TDesk as generated a LONG signal, so have enough candles
         //fallen to generate a scalp trade short.
         if (HaveEnoughCandlesReversed(down) )
         {
            take = NormalizeDouble(bid - (CtsTakeProfit / factor), digits);
            stop = NormalizeDouble(bid + (CtsStopLoss / factor), digits);
            
            SendSingleTrade(symbol, OP_SELL, CtsTradeComment, Lot, bid, stop, take);
         }//if (HaveEnoughCandlesReversed(down) )
         
      }//if (BuyOpen)
      
      //Send a scalping buy
      if (SellOpen)
      {
         //TDesk as generated a LONG signal, so have enough candles
         //fallen to generate a scalp trade short.
         if (HaveEnoughCandlesReversed(up) )
         {
            take = NormalizeDouble(ask + (CtsTakeProfit / factor), digits);
            stop = NormalizeDouble(ask - (CtsStopLoss / factor), digits);
            
            SendSingleTrade(symbol, OP_BUY, CtsTradeComment, Lot, ask, stop, take);
         }//if (HaveEnoughCandlesReversed(down) )
         
      }//if (SellOpen)
               
   }//if (UseTdeskFlatSignal)
   
   
}//End void DoCtsTrading(string symbol, int signal)
For the incremental lot sizing thingy, go to the bool LookForTradingOpportunities(string symbol, int pairIndex, int type) function. A few lines down, you will see this code block:

Code: Select all

   double SendLots = Lot;
   if (UseIncrementalLotSizing)
      SendLots = HighestLotSoFar + LotIncrement;
I have added an extra conditional:

Code: Select all

   double SendLots = Lot;
   if (UseIncrementalLotSizing)
      if (!CloseEnough(HighestLotSoFar, 0))
         SendLots = HighestLotSoFar + LotIncrement;
:xm: :rocket:
Author:  SteveHopwood [ Wed Dec 12, 2018 11:43 am ]
Post subject:  Desky. TDesk's trading drone.

A question for our friends in the US.

Are you folks able to use Desky's grid trading feature, combined with basket trading? If not, would someone explain the FIFO rules in detail so I can do something about it.

:xm: :rocket:
Author:  zoltankiss [ Wed Dec 12, 2018 12:34 pm ]
Post subject:  Desky. TDesk's trading drone.

SteveHopwood » Wed Dec 12, 2018 3:43 am wrote:A question for our friends in the US.

Are you folks able to use Desky's grid trading feature, combined with basket trading? If not, would someone explain the FIFO rules in detail so I can do something about it.

:xm: :rocket:
Steve,

Attached the .pdf with a great explanation of FIFO.

I'm not using the grid yet, still fighting to find an acceptable money management for Desky, but it's a bit hard with all these non-sense rules in the US (no hedge, FIFO, usual high spread (average 2-5 pips))

Thank you,

Zolie
All times are UTC Page 16 of 50