William Roeder: You call TSAS which has its own
select loop. Therefor your modify is now processing a different order.
Ok so how can I tell the EA not to modify orders with a TrailingStop added? And most of all, how can I avoid the EA placing stop losses from a chart
to another chart?
i tried putting this, but will be able to test it on monday:
It definitely is a source code problem; your broken code. What part of "One loop only" was unclear?
for(int i=OrdersTotal()-1; i>=0; --i) One loopif(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)&& OrderMagicNumber() == MIDBMAGICMA && OrderSymbol() == _Symbol){
^^ above you selected an order on the current chart. if(TrailingStopAdvanceSell() == false){ Second loop.^^ Above function selected other orders.
vv Below tries to test and modify some other order using chart values.
if(OrderStopLoss() > BBMid .. }
else{
if(!OrderModify(OrderTicket(),Ask
You call TSAS which has its own select loop. Therefor your modify is now processing a different order.
Ok so how can I tell the EA not to modify orders with a TrailingStop added? And most of all, how can I avoid the EA placing stop losses from a chart to another chart?
i tried putting this, but will be able to test it on monday:
{ if(OrderType() == OP_SELL) { if(TrailingStopAdvanceSell() == true || OrderStopLoss() < OrderOpenPrice()) break; else ...Here's the list of what have i tried to work-around this error:
- Assigning Ad-Hoc Magic Number to each symbol
-Counting Orders LIFO instead of FIFO
-Correcting the "Price" parameter in OrderModify functions with "OrderOpenPrice()"
You selected an order on the current chart; process it. One loop only.
Here's proof of what I'm saying in the log Mr. Roeder, this should make it definitely clear that it might be a source code problem.
And if I close that position, it will now place the SL on another position like proved in the log.
It definitely is a source code problem; your broken code. What part of "One loop only" was unclear?
Ok I had unclear the loop concept, sfortunately I'm kind of new to this. Now i got it precisely.
So to avoid placing the stop loss when the trailing stop is placed i simply called in a simple equation.
This is what the code looks like now. Thanks for your patience Mr. Roeder.