| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| My shell EA code https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=79 |
Page 9 of 23 |
| Author: | NeoTrader [ Thu Aug 30, 2012 7:31 am ] |
| Post subject: | Re: My shell EA code |
Hi Steve, me again... Still in the Process of making the documentation and getting to grip with your Shell EA I tumbled over something that I think you should look at. ModifyOrder() Your ModifyOrder() Function never reports back if the modify was successful or not...it only creates an Error Report. This means that SendSingleTrade() can create an order and if the crim is an ECN and the ModifyOrder fails you would have an open Order without SL/TP set. Wouldn't it be better to define ModifyOrder as bool and send a true/false back if it was successful or has failed? And repeat the Modify Process till it succeeds? Or did I miss something? happy trading, NeoTrader - |
|
| Author: | SteveHopwood [ Thu Aug 30, 2012 8:39 am ] |
| Post subject: | Re: My shell EA code |
Welcome to the warped and twisted world of Crapql4 order sending - my world. What if the ordermodify continues to fail? What if continued, unlimited attempts to modify the order sets up unforeseen memory problems that cause an endless loop, platform freeze or computer crash? Is this possible? I do not know, but I tell you this: we are relying on a combination of Crapdows os, Empty4 and Crapql4. Is the sort of scenario I describe above so unlikely? And how about all the possible combinations this Trio of Woe and Cataclysmic Crap might throw up that we cannot foresee? No idea what they might be, because nobody has foreseen them. Apart from the cowboys who programmed all this rubbish, who have probably built in quite a lot of stuff deliberately to make watertight code almost impossible to achieve. Those were the questions that raced through my mind when I contemplated the very same problem you raised, back when Matt first produced the code. InsertStopLoss/TakeProfit are the functions that deal with the prob. They are both called from within CountOpenTrades and insert said thingies when they should be there but are not. Developers just need to be aware that the functions might need adapting to suit the needs of the system. |
|
| Author: | NeoTrader [ Thu Aug 30, 2012 10:32 am ] |
| Post subject: | Re: My shell EA code |
hi Steve Ok... I understand the problematic...but if the ModifyOrder fails when you call it then the other two Functions will also fail because of the same Problem because all three Functions use the OrderModify Function of Empty4 to complete their task. Wouldn't it be better to make the ModifyOrder as reliable as possible so we don't need to tweek around it...possibility to do so would be to use the sleep function O_R_Sleep that you already use in O_R_CheckForHistory() instead of the Sleep(100). Or to integrate the CalculateStopLoss and CalculateTakeProfit calls into it. Why handle and deal with 3 Functions if one clean Function could do this? It would make the code clearer and more logical. Or get rid of order modify and call only InsertStopLoss/TakeProfit. Redundant code is always bad and confuses people. By the way I think I found a bloop in your InsertStopLoss() Function in the current ShellEA BareBone The red selection should be OP_BUY if I'm not wrong (Line1683). happy trading, NeoTrader - |
|
| Author: | SteveHopwood [ Thu Aug 30, 2012 11:53 am ] |
| Post subject: | Re: My shell EA code |
They try again at every tick and alert me to a problem. I am happy with this as it is - it ain't bust so I ain't fixin' it. Yep. I have to fix this every time I use the shell, but by then I have renamed it and am busy, and so forget to return to the shell and add the fix. Done it now, rather than wait and forget again. Cheers. |
|
| Author: | NeoTrader [ Fri Aug 31, 2012 12:41 pm ] |
| Post subject: | Re: My shell EA code |
hi Steve, We could get philosophical about this... thats why you need this two Functions.. But I will not go there...you're the Boss and this is your castle aehem code.. happy trading, NeoTrader - |
|
| Author: | NeoTrader [ Sat Sep 01, 2012 9:53 am ] |
| Post subject: | Re: My shell EA code |
hi steve, and again some observations and thoughts... Function CalculateTradeProfitInPips(int type) I know that you don't really use this Function actively anywhere in your Code. But it is still there and therefore I thought I check this up with you. In the call of the Function there is a Function Parameter "type" but you don't use this parameter inside your code. Shouldn't the "type" parameter used here instead of the OrderType() Function? Function GetSwap() This Function uses only the current Symbol to get the Swap Values. Wouldn't it be better to use GetSwap(symbol) to be more flexible and also usable in multi-pair EA's? Thanks in advance, NeoTrader - |
|
| Author: | SteveHopwood [ Sat Sep 01, 2012 9:10 pm ] |
| Post subject: | Re: My shell EA code |
Yes to both, and thanks. I have made the changes and uploaded to post 1 for the benefit of others taking notice of what is happening here. Note that I do not use the shell for coding multi-pair ea's. I usually adapt one of the existing multi-pair bots instead. I rarely code a multi-trader and so do not have a multi-trader shell. This shell is intended for adaptation for single-pair use. Doesn't stop me accepting contributions that make it more flexible, so many thanks again. By the by, I have received your pm and am not ignoring it. I have been engaged on a project today, and an upcoming 'new toy' pm will explain. |
|
| Author: | NeoTrader [ Mon Sep 10, 2012 11:25 am ] |
| Post subject: | Re: My shell EA code |
Hi Steve, found another thingy that got some bells ringing. Function JumpingStopLoss() Line2007 if (Bid >= sl + ((JumpingStopPips * 2) / factor) )//George{ Line2024 if (Bid <= sl - ((JumpingStopPips * 2) / factor) )//George Can you tell me why you multiply the JumpingStopPips with 2 here? Thanks in advance, happy trading, NeoTrader |
|
| Author: | gaheitman [ Mon Sep 10, 2012 11:37 am ] |
| Post subject: | Re: My shell EA code |
If the JSL is set for 40, it has to move 80 before it jumps 40. It basically locks in half of the move every time we have 2 x JumpingStopPips of room between SL and price. George |
|
| Author: | NeoTrader [ Mon Sep 10, 2012 12:13 pm ] |
| Post subject: | Re: My shell EA code |
Hi George, Ahhh...ok...now I understand...it's logical...didn't visualized it right in my brain... Thanks again, happy trading, NeoTrader - |
|
| All times are UTC | Page 9 of 23 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|