| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Trendy Monster Moving Day https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5904 |
Page 5 of 6 |
| Author: | Maximilian [ Sat May 15, 2021 2:22 pm ] |
| Post subject: | Trendy Monster Moving Day |
Hi Steve and all other coders, I am kind of desperate at the moment. I adapted the code and this is what I try to do: Like the original version I want Trendy Monster to open a grid, I added individual TP and SL for the grid. The first pending order, which actual triggers the grid shall close at the SL and then all grid orders shall be deleted. But it doesn´t work somehow. Code: Select all Maximilian |
|
| Author: | SteveHopwood [ Sat May 15, 2021 4:18 pm ] |
| Post subject: | Trendy Monster Moving Day |
This reminds me that biobier sent me a fix for something a few weeks ago. I thought to myself, "I will add the fix tomorrow," and forgot about it. I will look at all this tomorrow. In the meantime, send me the entire function in a PM. |
|
| Author: | Maximilian [ Sat May 15, 2021 4:27 pm ] |
| Post subject: | Trendy Monster Moving Day |
Hi Steve, will do. But I don´t think it´s because of your code. Cheers Max |
|
| Author: | SteveHopwood [ Sun May 16, 2021 10:10 am ] |
| Post subject: | Trendy Monster Moving Day |
What is your SendLimitOrder input? |
|
| Author: | Maximilian [ Sun May 16, 2021 10:14 am ] |
| Post subject: | Trendy Monster Moving Day |
I set ist to false. I just use stop Orders. |
|
| Author: | SteveHopwood [ Sun May 16, 2021 10:27 am ] |
| Post subject: | Trendy Monster Moving Day |
I was hoping that would be your reply. I will post a version with a fix for this and biobier's spot later, along with DIY instructions. For your satisfaction Max, the void deleteOrphanPendings(string symbol, int pairIndex) is intended to deal with pending orders left behind by a market order closure. Go to it and work out for yourself why it is not working for you. Incidentally, I do not see why your code is not working but it would not be needed but for the bloop in deleteOrphanPendings(). |
|
| Author: | Maximilian [ Sun May 16, 2021 11:56 am ] |
| Post subject: | Trendy Monster Moving Day |
I got a brainfart and tell me if it´s wrong or intended: Unless one uses HiddenSLTP the stop and take is stored in the OrderStopLoss() or OrderTakeProfit(). So there´s no code needed for closing the trade at TP or SL. Empty4 just closes the order no matter what. And after closing there is no market trade open, which would cause Trendy Monster to call the lookingforTradeclosure (because it´s called from COT routine) right? So question is, if I just misunderstood the purpose of the function this the routine. Is it just for trades where the SL or TP isn´t aleready saved in the order data, e.g HiddenSLTP or exit routines like reaching a SupplyDemand Zone? Thanks, Maximilian |
|
| Author: | SteveHopwood [ Sun May 16, 2021 4:17 pm ] |
| Post subject: | Trendy Monster Moving Day |
V 1l is in post 1, with the fix offered up by biobier and my attempted fix for Max's stop orders not deleting. The easiest way to DIY is to navigate to: void deleteOrphanPendings(string symbol, int pairIndex) Copy this over the top of the entire function: Code: Select all |
|
| Author: | SteveHopwood [ Sun May 16, 2021 4:35 pm ] |
| Post subject: | Trendy Monster Moving Day |
lookForTradeClosure() is only called for open market orders. I am not sure that Trendy can do what you require but try it with the fixes. You can also try the attached management EA. I was experimenting with sending stop instead of limit orders using Richard's TDesk setup and stop orders were being left behind if a market order(s) hit stop loss. The attached manager takes care of this. The GridSize input needs to be the same as Trendy's if you are only sending stop orders. It needs to be Trendy's grid size + 1 if you are sending an immediate market order. |
|
| Author: | Maximilian [ Sun May 16, 2021 4:38 pm ] |
| Post subject: | Trendy Monster Moving Day |
Thank you very much Steve, I will try all the options and hopefully find a solution, Greetings, Maximilian |
|
| All times are UTC | Page 5 of 6 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|