Breakeven not working
fabian waldo: But it seems to ignore the breakeven totally...
|
|
whroeder1:
|
I added this to my code but nothing came up in errors in the journal. Also code compiles with no errors at all.
if ( OrderSelect(i, SELECT_BY_POS,MODE_TRADES) == false) // do something if the OrderSelect did not work Alert("the order isn't close because Err no. ", GetLastError()); }
if ( OrderSelect(i, SELECT_BY_POS,MODE_TRADES) == false) // do something if the OrderSelect did not work
Alert("the order isn't close because Err no. ", GetLastError());
That doesn't make sense. The alert should relate to the OrderSelect() failing.
int BBM=OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,clrNONE);
OrderModify() returns a bool, not an int.
If it returns false then print an error report
if(!OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,clrNONE)) Print("Order Modify on ticket #",OrderTicket()," Failed. ERROR CODE",GetLastError());
I have this in my EA and it compile and run with no errors. All trades are made in backtester as well. But it seems to ignore the breakeven totally...
Is there something wrong here?