| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Desky. TDesk's trading drone. https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545 |
Page 11 of 50 |
| Author: | SteveHopwood [ Sat Nov 10, 2018 2:36 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Found the trade management thingy. I had changed the variable names in line with my usual coding practice and forgot to initialise them. DIYers, put this at the top of OnInit(): Code: Select all Thanks Vince. You were really helpful. |
|
| Author: | SteveHopwood [ Sun Nov 11, 2018 3:01 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
V2 is in post 1, with all the latest fixes. I tracked down the cause of the basket pips thingy not working. It took me over two hours, because I am an idiot. With the markets closed, I was able to load up Desky and see him immediately try to close my trades with BasketTargetPips = 500 - despite the position being about -900. I sifted through every block of code in OnInit() first, then OnTimer(), inserting an Alert and return after each block. This eventually took me to this line of code: pips = (int) CalculateTradeProfitInPips(OrderType()); - do a search for it as there is only the one instance. This was returning ridiculous results, so I looked at double CalculateTradeProfitInPips(int type). Do the same and you will see the dummy mistake immediately e.g. profit = bid - OrderOpenPrice(); The 'bid' variable was set to whatever it was after its last iteration through the loop in OnTimer(). The solution is to go back to void CountTradesForGlobalBasket(), scroll down to: if (!BetterOrderSelect(cc, SELECT_BY_POS, MODE_TRADES) ) continue; and add this immediately underneath: GetBasics(OrderSymbol()); This populates the add, bid etc variables with the correct price. And that took me more than two sodding hours. Hey ho. |
|
| Author: | trader689 [ Sun Nov 11, 2018 9:22 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Great thanks Steve! All set for the new week with a fixed Desky - woot |
|
| Author: | SteveHopwood [ Mon Nov 12, 2018 12:29 am ] |
| Post subject: | Desky. TDesk's trading drone. |
The fucking Recovery function still does not work properly. Turn it off, dammit. I had changed some of the variables to global ones i.e. BuyTickets to GlobalBuyTickets. What was I on when I did this? In the fupdated unction I now have on my demo account, the functions is: Code: Select all I am starting to lose the will to live here. |
|
| Author: | SteveHopwood [ Mon Nov 12, 2018 12:28 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Recovery still is not working folks. Turn it off for now. |
|
| Author: | Gertje [ Mon Nov 12, 2018 12:56 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Here is the code from an EA where the recovery works like a charm. No idea if the code is compatible, I'm no code-slinger by far. Code: Select all |
|
| Author: | SteveHopwood [ Mon Nov 12, 2018 1:01 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
I think Recovery is working now - V 2a in post 1. I commented out the line of code that closed trades when the Recovery price is reached and so was able to add some Alerts to show what was happening. It turns out that we do need the -1 in the overall divide code. Here is the function, so you can see where I put the alerts: Code: Select all |
|
| Author: | SteveHopwood [ Mon Nov 12, 2018 2:06 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Thanks. I only just saw this. This is the code I adapted for Desky. I have not checked but will probably find that I used slightly different code to size and populate the array. I am over-complicating thingies anyhow. CountOpenTrades() calculates a variable to hold the number of market trades - MarketBuysCount. I could have used this instead and will try it: RecoveryTargetPrice/= MarketBuysCount; Not to worry. The function is working now: +$255 Hehe. You can see why Thomas did not want to get involved with coding Desky - no doubt he has enough hair-tearing to do with TDesk. |
|
| Author: | SteveHopwood [ Mon Nov 12, 2018 3:37 pm ] |
| Post subject: | Bloop alert |
Desky on vy FX VPS wasn't trading, so I had a look and there is a mistake in the code that tells Desky what to do if EveryTickMode = false. I am adding another anti-overtrading filter, and so will upload the fix later. DIYers, do a search for, "if (CandleOpenTime[pairIndex] != iTime(symbol, EveryTickTimeFrame, 0) )" and change it to: if (CandleOpenTime[pairIndex] == iTime(symbol, EveryTickTimeFrame, 0) ) |
|
| Author: | SteveHopwood [ Mon Nov 12, 2018 4:52 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
V 2b is in post 1, with the fix I described in my previous post. I have added a new anti-overtrading filter. From the updated UG:
|
|
| All times are UTC | Page 11 of 50 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|