- Search Energy EXCH
- 36 Results (2 Threads, 34 Replies)
- ydrol replied Sep 10, 2013
I would simply use OrderSymbol() = Symbol(). Rather than expect end user to change the Magic number for each chart. It's pretty much a standard approach.
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 10, 2013
The point I'm making is, having one EA manage multiple charts whilst only getting ticks from one chart, does not seem like a good design when the EA behaviour is time critical (eg for TP, SL). It seems like it would cause all kinds of race ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 10, 2013
Just from inspection... Personally I think you should limit the EA to the chart it is on. (check OrderSymbol() = Symbol() ) Why? 1) because people may want to have different levels of pips for different instruments (as they behave differently). By ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 9, 2013
Why do you need hundreds of records? For each order I would start with two GV's, one for the SL, one for the TP, The other data is stored in the terminal (accessible via OrderXXXX functions) so I would keep it there and not bother to duplicate it. ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 9, 2013
No problem.. Main things I think are: - using global variables to store SL/TP (prefix variable names with WindowExpertName() + OrderTicket() ) - this will make lookups simpler , and also make the code more resilient. - Only storing data you will ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 9, 2013
And So by default the EA will attempt to manage all manual orders across all pairs (even charts it is not attached to), using the wrong Market prices, because there is no test "OrderSymbol()=Symbol()" in the loop, a very simple check.
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 8, 2013
Nothing wrong with honest enthusiasm, but if you had actually stopped to read the other threads , apart from being several years old, some were discussing more advanced trailing stops than what you have presented here, (eg traling stops based on ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 6, 2013
Also re OP's code, if there are no orders it will burn CPU calling CloseAll() and OrdersTotal() ?
MetaQuotes 4 Coding Lessons
- ydrol replied Sep 6, 2013
The language in the first posts and the spamming of dead threads, suggest it was a promotion/freebie for the website... " Our mission is to research on effective technical trading methods and building an EA to trade the Forex market." But I suspect ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 6, 2013
Another possible bug, After closing an order, you probably want to stop any further processing and continue to the next one... This may or maynot be a bug, depending on how complete further tests are, but I think best practice would suggest short ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 6, 2013
Also, You store stealth data in OrderArray which is resized every tick. Say this stores entries for orders 1,2 and 3. OrdersArray[0] = Order #1OrdersArray[1] = Order #2OrdersArray[2] = Order #3 If Order 1 is closed , its entries are reset to zero. ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 6, 2013
Understand enthusiasm but you responded to several dead threads, and there are common MQL4 errors in the code ... Another one, you should check the OrderSymbol as well as the Magic Number. url So probably just as well you didnt sell it at this ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 6, 2013
You really just spammed/resurrected every "trailing stop" thread even if its 4 years old? In addition you have some common MQ4 errors in the code, so maybe fix these before promoting it too widely.. Re " for (i=0; i<OrdersTotal(); i++) { ... ...
EA to prevent Losses on a Winning Trade
- ydrol replied Sep 2, 2013
Note the reconnect script appears to run 24/7. Maybe it could be restricted to major sessions etc?
Improve MT4 order execution speed by 500ms
- ydrol replied Aug 15, 2013
As a result of some discussion over on mql4 forum (not sure why I do it to myself but anyway...).... I have observed that MT4 client creates a socket connection in which it receives quote data, but for OrderSend/Modify/Delete/Close , it creates an ...
Improve MT4 order execution speed by 500ms