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

Desky. TDesk's trading drone.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545
Page 3 of 50
Author:  SteveHopwood [ Mon Oct 15, 2018 9:54 am ]
Post subject:  Bloop alert

David has pm'd again after spotting some more logic bloops - fixed in post 1.

The easiest DIY is to go to line 3411: if (signal == LONG)
There you will see two blocks of code ending at line 3443: }//if (signal == SHORT)

All the instances of: OP_BUY and BuyClosureFailure: OP_SELL and SellClosureFailure are in the wrong blocks. Either change them all manually or copy this over the top of the existing code:

Code: Select all

      //Opposite signal closure
      if (signal == LONG)
      {
         if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes)
            BuySignal = true;
         if (CloseOnOppositeSignal)
         {
            SellClosureFailure = false;
            CloseAllTrades(symbol, OP_SELL);
            if (ForceTradeClosure)
            {
               SellClosureFailure = true;
               pairIndex--;
               continue;
            }//if (ForceTradeClosure)
         }//if (CloseOnOppositeSignal)
      }//if (signal == LONG)
      
      if (signal == SHORT)
      {
         if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes)
            SellSignal = true;
         if (CloseOnOppositeSignal)
         {
            BuyClosureFailure = false;
            CloseAllTrades(symbol, OP_BUY);
            if (ForceTradeClosure)
            {
               BuyClosureFailure = true;
               pairIndex--;
               continue;
            }//if (ForceTradeClosure)
         }//if (CloseOnOppositeSignal)
      }//if (signal == SHORT)
Thanks again David. :clap: :clap: :clap: :clap: :clap:

:xm: :rocket:
Author:  davista [ Mon Oct 15, 2018 10:05 am ]
Post subject: 

SteveHopwood » Mon Oct 15, 2018 9:54 am wrote:David has pm'd again after spotting some more logic bloops - fixed in post 1.

...

Thanks again David. :clap: :clap: :clap: :clap: :clap:

:xm: :rocket:
Happy to help. I've been a silent lurker for a while now, but hopefully I can now finally make some useful contributions to SHF :)
Author:  SteveHopwood [ Mon Oct 15, 2018 10:13 am ]
Post subject:  Desky. TDesk's trading drone.

Bear in mind folks if you did it yourself after David's post, that there were more bloops in that section of code than he noticed. The logic was entirely the wrong way around. Go back to mine a couple of posts higher up than this one and make the extra changes.

:xm: :rocket:
Author:  SteveHopwood [ Mon Oct 15, 2018 5:49 pm ]
Post subject:  Desky. TDesk's trading drone.

I just realised that I have not added hedging to Desky. I am thinking HedgeOnOppositeDirectionSignal. I will add it as soon as I can.

:xm: :rocket:
Author:  SteveHopwood [ Tue Oct 16, 2018 4:27 pm ]
Post subject:  Desky. TDesk's trading drone.

Recovery is not working properly folks. Turn it off until I can sort it out.

:xm: :rocket:
Author:  c1borg [ Tue Oct 16, 2018 8:32 pm ]
Post subject:  Desky. TDesk's trading drone.

no urgency but can I add a request for % profit per day basket profit closure as used in AwesomeSS :youknow:
Author:  SteveHopwood [ Tue Oct 16, 2018 8:33 pm ]
Post subject:  Desky. TDesk's trading drone.

I am putting this here because I know that a lot of SHF members are reading this thread.

A number of major thread runners are feeling the sort of frustration that I often felt many years ago, before I developed my robust way of dealing with dimwits.

They are mostly gentle souls, unwilling to press the nuclear button.

I am not a gentle soul unless you are a teen. I doubt there are many teens here, so most of you are in danger of a ban from me. There are too many idiotic posts from lazy and stupid people appearing at SHF these days.

So I give everyone this fair warning: post lazily and/or stupidly and I will ban you unless it is a thread where you are allowed to be as thick as you like - and I make it perfectly clear in post 1 when this is allowed. Beginners' threads apart, I do not care whose thread it is. I am on a dimwit-banning warpath. There will be no warning and the security software that Tommaso has put in place will prevent you from re-joining.

I remind people of the SHF ethos. SHF is a meritocracy, not a democracy. Got nothing useful to say? Don't say it.

In doubt about whether to post or not? Stay quiet. Or ask in the beginners' threads assigned to you.

Take no comfort from the usual sign off that I am about to add. I am not joking.

:xm: :rocket:
Author:  SteveHopwood [ Tue Oct 16, 2018 8:35 pm ]
Post subject:  Desky. TDesk's trading drone.

c1borg » Tue Oct 16, 2018 8:32 pm wrote:no urgency but can I add a request for % profit per day basket profit closure as used in AwesomeSS :youknow:
Yes you can and I will provide it. You might have to nudge me from time to time. You have earned the right to do so.

:xm: :rocket:
Author:  SteveHopwood [ Wed Oct 17, 2018 9:59 am ]
Post subject:  DIY fix

A quick DIY fix folks, for the grid traders. I have been tearing my hair out this morning wondering why the stop and limit orders were being sent at the same price.

Go to void SendBuyGrid(string symbol, int type, double price, double lot) and the cause will probably leap out at you immediately. There are four instances of "Digits" which is the constant for the chart symbol. These need replacing by, "digits" which is the variable that holds the digits count for the symbol being traded.

Peasants' fix coming when I have worked out what is wrong with Recovery.

:arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg:
Author:  SteveHopwood [ Wed Oct 17, 2018 10:19 am ]
Post subject:  Desky. TDesk's trading drone.

V 1h is in post 1. The fix for the stop and limit order price thingy has worked. 1h also attempts a fix for the Recovery thingy.

DIYers, there are two variables that tell Desky that the pair is in recovery - BuysInRecovery and SellsInRecovery. Once set, they were never reset, so Desky regarded all pairs as needing recovery.

Do a search for, "if (MarketBuysCount >= TradesToStartLookingForRecovery)//Minimum trades to constitute Recovery" and insert this directly above:

Code: Select all

      BuysInRecovery = false;
      SellsInRecovery = false;
      
Include the space and our line numbers are still the same.

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