YES-TM EA Version 1.1 Beta released. It seems to work fine on my testing. But due to the time constrain, I may miss some bugs. So, do report them if you find any.
When in doubt, wait it out.
Prevent every trade before executing - My "isAllowed" 2 replies
Averaging Up your winning trade ? 11 replies
Do you believe tight stop-losses cause losses in the long run? 76 replies
Do you believe fixed stop-losses cause losses in the long run? 16 replies
Are winning trades immediately available for trade? 3 replies
loop { bool closeTheOrder = false; if (type = OP_BUY) { if ( blah ) { closeTheOrder = true; } if (blah blah) { closeTheOrder = true; } } else if (type = OP_SELL) { if ( blah ) { closeTheOrder = true; } if (blah blah) { closeTheOrder = true; } } ... if (closeTheOrder) { //close the order here with retry code. }
Disliked2) as you've realized, because it will only run on ticks received by the main chart, so other charts only get updated with the main chart ticks and not when they get ticks.Ignored
DislikedYou are also still not continuing to the next order after calling OrderClose(). To close the order I would just set a boolean rather than duplicating the OrderClose code.Ignored
DislikedI have some trailing stop functionality in my own EA, and key requirements (for me) were
1. sends wider trailing stops to the broker for safety, (using 10 pip boundaries to reduce OrderModify traffic)
2. managed terminal restarts ok,
3. adapts to market conditions somehow rather than using fixed values (this was being discussed in one of the threads you posted to )Ignored
DislikedCan anyone post an EA for placing the buy and sell stop orders, for monitoring, and for closing them.Ignored
Disliked{quote} You can achieve that by setting a unique magic number with each chart to have different tp,sl, ts setting. For me, I need the EA to manage all pairs from one chart. That's why it is designed that way. {quote} That's why I suggest to have this EA attached to an active chart.Ignored
Disliked{quote} A1: My does not use ordermodify. It is not stealthy if use ordermodify.Ignored
DislikedMarket condition? Something worth serious exploring. Wonder if you have any guidance on market speed, trend, retracement & reversal.Ignored
DislikedYou also skipped this point:
"1) because people may want to have different levels of pips for different instruments (as they behave differently).
By making the one EA do all instruments with the same settings, it actually becomes less flexible."
The above issues are created by trying to manage multiple charts with a single EA instance, both issues go away with one EA instance per chart. This kind of thing indicates bad design. I'd rather have multiple EAs behaving properly and efficiently , than one EA behaving suboptimally. But that's...Ignored
DislikedYou are not understanding me. If my computer crashes with disk failure I still want to make sure there is a real stop loss registered with the broker to safe guard my account. So as well as having stealth values managed by the EA, I have (wider) fake values that are sent to the broker. As my stealth values move, so do the fake ones. Hence I still send OrderModify to the broker. I've also seen a few other examples of people doing the same.Ignored
DislikedYou can achieve what you want with this EA. Let's say you have 2 pairs that you wish to trade. The "XAUUSD" and "GBPJPY". You attach this EA to "XAUUSD" with tp:500, sl:250, ts1:100 with Magic Number of "1234". The EA will only manage trade with magic number "1234". Then, you attach this EA to "GBPJPY" with the magic number of "5678" and with the setting of tp:50, sl:50, ts:10. The EA will only manage trade with magic number "5678" which is unique to this "GBPJPY". I don't use and GV that can interfere with each other. These 2...Ignored
DislikedNothing 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 Market conditions - Volatility Stops , Dynamic Trailing Stops) - so your posts would just waste those people's time in those particular threads if they were still following. What you are doing isn't that unique or new, so it should at least be robust.Ignored
for (ii=TotalNumberOfOrders-1; ii>=0; ii--) {
if (OrderSelect(ii, SELECT_BY_POS, MODE_TRADES)) {
// //Print (i+"/"+TotalNumberOfOrders+">>"+OrderSymbol()+">>"+OrderTicket()+">>"+TotalNumberOfOrders);
if (OrderMagicNumber()==Magic && (OrderType() == OP_BUY || OrderType() == OP_SELL)) {
FoundZero = FALSE;
OrderFound = FALSE;
for (j=TotalNumberOfOrders-1; j>=0; j--) {
//Print ("After reset:"+j+">>"+OrderArray[j][0]);
if (OrderArray[j][0]==OrderTicket() && (OrderType() == OP_BUY || OrderType() == OP_SELL)) {
OrderFound = TRUE;
OrderArrayIdx = j;
break;
}
if ((OrderArray[j][0]==0) && (!FoundZero) && (!OrderFound)) {
FoundZero = TRUE;
FoundZeroIdx = j;
}
}
////Print ("OrderFound:"+OrderFound+">> FoundZero:"+FoundZero+">> TotalNumberOfOrders:"+(TotalNumberOfOrders-1)+">>"+i);
if (!OrderFound && FoundZero) {
if (OrderType() == OP_BUYSTOP || OrderType() == OP_SELLSTOP) continue;
OrderArray[FoundZeroIdx][0] = OrderTicket();
OrderArray[FoundZeroIdx][1] = OrderMagicNumber();
OrderArray[FoundZeroIdx][2] = OrderType();
OrderArray[FoundZeroIdx][3] = OrderLots();
OrderArray[FoundZeroIdx][4] = OrderOpenTime();
OrderArray[FoundZeroIdx][5] = OrderOpenPrice();
OrderArray[FoundZeroIdx][6] = OrderCommission();
OrderArray[FoundZeroIdx][7] = OrderTakeProfit();
OrderArray[FoundZeroIdx][8] = OrderStopLoss();
OrderArray[FoundZeroIdx][9] = 0; //TS1
OrderArray[FoundZeroIdx][10] = 0; //TS2
OrderArray[FoundZeroIdx][11] = 0; //TS3
OrderArray[FoundZeroIdx][12] = 0; //TS4
OrderArray[FoundZeroIdx][13] = 0; //TS5
FoundZero = FALSE;
} else {