i am using a "Switch" function to modify the open order at each profit level,(each case # represents the amount of profit) however for some reason the ModifyOrder() function is not working, i have the order selected properly and i am entering the case function properly becuase when i take the actual modifyOrder operator that is supposed to change the stoploss and replace it with a Alert() the Alert() is working, so i am able to deduce that everything is working properly except for the way that i am using the ModifyOrder() function.
this is what my switch function from the EA i wrote looks like:
if(OrdersTotal() > 0 && OrderSelect(0, SELECT_BY_POS)==true && A==1)
{
switch(OrderProfit())
{
case 0 : OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss()-4,OrderTakeProfit(),0,Blue); break;
case 1 : Alert ("profit is 1"); break;
case 2 : Alert ("profit is 2"); break;
case 3 : Alert ("profit is 3"); break;
case 4 : Alert ("profit is 4"); break;
case 5 : Alert ("profit is 5"); break;
case 6 : Alert ("profit is 6"); break;
case 7 : Alert ("profit is 7"); break;
case 8 : Alert ("profit is 8"); break;
case 9 : Alert ("profit is 9"); break;
case 10 : Alert ("profit is 10"); break;
case 11 : Alert ("profit is 11"); break;
}
.......................................................................
what am i doing wrong in the OrderModify()?
am i entering the ticket, openprice and stoploss wrong?
my EA only allows for a max of 1 order open at a time.
mabye someone could direct me to some literature that is very detailed about OrderModify() and OrderClose() i am prettysure i have read just about everything over at book.mql4.com and it didnt help me
this is what my switch function from the EA i wrote looks like:
if(OrdersTotal() > 0 && OrderSelect(0, SELECT_BY_POS)==true && A==1)
{
switch(OrderProfit())
{
case 0 : OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss()-4,OrderTakeProfit(),0,Blue); break;
case 1 : Alert ("profit is 1"); break;
case 2 : Alert ("profit is 2"); break;
case 3 : Alert ("profit is 3"); break;
case 4 : Alert ("profit is 4"); break;
case 5 : Alert ("profit is 5"); break;
case 6 : Alert ("profit is 6"); break;
case 7 : Alert ("profit is 7"); break;
case 8 : Alert ("profit is 8"); break;
case 9 : Alert ("profit is 9"); break;
case 10 : Alert ("profit is 10"); break;
case 11 : Alert ("profit is 11"); break;
}
.......................................................................
what am i doing wrong in the OrderModify()?
am i entering the ticket, openprice and stoploss wrong?
my EA only allows for a max of 1 order open at a time.
mabye someone could direct me to some literature that is very detailed about OrderModify() and OrderClose() i am prettysure i have read just about everything over at book.mql4.com and it didnt help me