English

## Dynamic Taking profit

 5 hampeh 2014.12.28 15:10   Hi,This is my idea. I want make moving or dynamic taking profit if pending order fill...PO=pending order, TP=taking profitExample:PO3---------------------------- = PO3 trigger, all TP at TP3 PO2---------------------------- = PO2 trigger, all TP at TP2TP3++++++++++++++++PO1---------------------------- = PO1 trigger, all TP at TP1TP2++++++++++++++++ TP1++++++++++++++++
 2017 gooly 2014.12.28 15:17 #   ok, go a head.Good luck!
 Moderator3206 angevoyageur 2014.12.28 16:09 #   hampeh: Hi,This is my idea. I want make moving or dynamic taking profit if pending order fill...PO=pending order, TP=taking profitExample:PO3---------------------------- = PO3 trigger, all TP at TP3 PO2---------------------------- = PO2 trigger, all TP at TP2TP3++++++++++++++++PO1---------------------------- = PO1 trigger, all TP at TP1TP2++++++++++++++++ TP1++++++++++++++++What is your problem ?
 12992 WHRoeder 2014.12.28 19:51 #   You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
 5 hampeh 2014.12.29 06:53 #   Maybe you can look to my coding....Still not working on modify taking profit..All previous value stored in array.....Thanks in advanced..... --------------------for(i=0;i
12992
WHRoeder 2014.12.29 17:30 #

hampeh: Maybe you can look to my coding....
`  if(MarketInfo(Symbol(),MODE_BID)<= minValueIdx)`
1.  Play video Please edit your post. For large amounts of code, attach it.

2. Why are you using a function all instead of just the predefined variable Bid?
3. Bid is a double (1.2345) Array indexes are int (0, 1, 2, 3...) What does price <= index possibly mean?
4. ```for(i=0;i<ArraySize(OpenPriceBuy);i++){
:
 5 hampeh 2015.01.05 08:15 #   `ok... now i see more beautiful.....````for(int cnt=0 ;cntArraySize(OpenPriceBuy))       {         j = ArraySize(OpenPriceBuy)-1;       }             //Modified TP only for open buy and pending buy (buy limit)             if(OrdersTotal() > 0 && (OrderType() == OP_BUY || OrderType()== OP_BUYLIMIT))             {             if(!OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),TPPriceBuy[j],OrderExpiration(),Red))             { Print("Buy OrderModify error :",GetLastError()); } else {Print(TPPriceBuy[maxValueIdx]," modified to : ",TPPriceBuy[j]);}             TPPriceBuy[maxValueIdx] = TPPriceBuy[ArraySize(OpenPriceBuy)-1];             OpenPriceBuy[maxValueIdx] = OpenPriceBuy[ArraySize(OpenPriceBuy)-1];             }       }    } ```