| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Desky. TDesk's trading drone. https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5545 |
Page 29 of 50 |
| Author: | renexxxx [ Sun Apr 14, 2019 11:34 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
What I usually try to do is to calculate for each symbol a lotSizeMultiplier such that if that symbol moves its expected dailyATR pips (per day), its dollar profit is the same for each symbol. So, we need to calculate for each symbol its dailyATR and a lotSizeMultiplier. (I do this with a struct for clarity, but you can do this you own way). Let's say, you have an array of symbols. This array is populated with all the symbols that the EA is managing. Code: Select all In the OnTimer() event handler, you would put a call to updateSymbols(), with updateSymbols defined as: Code: Select all Once we have this lotSizeMultiplier for each symbol, a trade would typically be opened with: Code: Select all Hope that this gives a general idea. |
|
| Author: | tomele [ Mon Apr 15, 2019 12:03 am ] |
| Post subject: | Desky. TDesk's trading drone. |
Yet another example of René's brilliance. I still learn from your code, my friend. Thomas |
|
| Author: | SteveHopwood [ Tue Apr 16, 2019 12:52 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Thanks Rene. That pointed me in the right direction. Folks, the attached is intended only to test my code. We only need the lot size calculated at order send time, so I have hacked Rene's code. Run it once and then disable EA's. It will show each symbol and the result of the calculation in an Alert, so have a look and see if they look correct/ish. The function is double GetDifferentialLotSize(string symbol) starting at line 6585 and the call is at line 6779, followed by the alert. |
|
| Author: | SteveHopwood [ Wed Apr 17, 2019 12:28 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
V 3j is in post 1. Rene has confirmed that my differential lot sizing code is accurate save one addition to cover an unlikely but possible, circumstance. Thanks again Rene. There are a few lot sizing options now, so I have moved them to their own inputs section. |
|
| Author: | SteveHopwood [ Thu Apr 18, 2019 3:43 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Some of you may notice that there is an update in post 1. You do not need it. One of our dafter members loaded Desky onto several charts and then wondered why there were several trades all sent at the same price point. Firm grasp of reality demonstrated there. This moron had a lucky escape because I ignored him and so did not spend several hours trying to find a bug that does not exist. You can perhaps imagine how I would have expressed a modicum of displeasure. The update contains code sent by Thomas, to stop other certifiable nutters from making the same lunatic mistake. |
|
| Author: | SteveHopwood [ Wed Apr 24, 2019 1:52 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
V 3k is in post 1. I have added a couple of inputs to the swap section:
|
|
| Author: | SteveHopwood [ Wed Apr 24, 2019 3:44 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
kwchau has just written to say that the latest swap feature is not working for grid trading. That will be because I have missed a place where the checks are needed. I will sort that out easily enough. Sing out if you find this feature not working elsewhere. |
|
| Author: | SteveHopwood [ Wed Apr 24, 2019 4:33 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
I have found the best place to add the swap checks. kwchau also wrote that the original checks were not working either - now I see why. If you downloaded 3k before this bloop emerged and want to DIY then this is easy. Do a search for this function definition: void CanWeSendTrades(string symbol, int pairIndex, int signal) Insert this at the top of the function: Code: Select all |
|
| Author: | SumTinWong [ Wed Apr 24, 2019 4:49 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
First Post here and I'm really trying to come accross as somewhat intelligent. Thank you Steve et al for this amazing repository of knowledge and very interesting tools. I have been playing around with TDESK and Desky (currently version 3i)for several weeks now and noticed a problem with grid trading returning error 130: Invalid Stops. Naturally I assumed that I must have broken something in my settings. The lightbulb moment came when I realized this error only appeared where there were existing profitable trades on the specific pair. I could not find any combination of settings to fix the situation but I did make this small adjustment to Desky which fixed the invalid stop error. Steve, I hope the following meets your approval, I'd hate to be banned from here Code: Select all |
|
| Author: | SteveHopwood [ Wed Apr 24, 2019 8:30 pm ] |
| Post subject: | Desky. TDesk's trading drone. |
Thanks for a most helpful post. I have updated Desky with this. Considering the changes today I have also updated the version number to 3l. This is an update you need folks. Clearly if one member can encounter this problem then we all will at some point - even if only rarely. I have replaced 'ask' with 'bid' in the sellstop/limit code. DIYers, here is how: Do a search for:SendBuyGrid(symbol, OP_BUYSTOP, HighestBuyPrice, Lot, targetNoOfPendingTrades); Replace it with: SendBuyGrid(symbol, OP_BUYSTOP, MathMax(ask,HighestBuyPrice), Lot, targetNoOfPendingTrades); Do a search for: SendBuyGrid(symbol, OP_BUYLIMIT, LowestBuyPrice, Lot, targetNoOfPendingTrades); Replace it with: SendBuyGrid(symbol, OP_BUYLIMIT, MathMin(ask,LowestBuyPrice), Lot, targetNoOfPendingTrades); Do a search for: SendSellGrid(symbol, OP_SELLLIMIT, HighestSellPrice, Lot, targetNoOfPendingTrades); Replace it with: SendSellGrid(symbol, OP_SELLSTOP, MathMin(bid, LowestSellPrice), Lot, targetNoOfPendingTrades); Do a search for: SendSellGrid(symbol, OP_SELLLIMIT, HighestSellPrice, Lot, targetNoOfPendingTrades); Replace it with: SendSellGrid(symbol, OP_SELLLIMIT, MathMax(bid,HighestSellPrice), Lot, targetNoOfPendingTrades); |
|
| All times are UTC | Page 29 of 50 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|