# Dynamic Taking profit

129

Hi,

This is my idea. I want make moving or dynamic taking profit if pending order fill...

PO=pending order, TP=taking profit

Example:

PO3---------------------------- = PO3 trigger, all TP at TP3

PO2---------------------------- = PO2 trigger, all TP at TP2

TP3++++++++++++++++

PO1---------------------------- = PO1 trigger, all TP at TP1

TP2++++++++++++++++

TP1++++++++++++++++

Moderator
6832

Good luck!

Moderator
35770

hampeh:

Hi,

This is my idea. I want make moving or dynamic taking profit if pending order fill...

PO=pending order, TP=taking profit

Example:

PO3---------------------------- = PO3 trigger, all TP at TP3

PO2---------------------------- = PO2 trigger, all TP at TP2

TP3++++++++++++++++

PO1---------------------------- = PO1 trigger, all TP at TP1

TP2++++++++++++++++

TP1++++++++++++++++

17995

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.
129

Maybe you can look to my coding....

Still not working on modify taking profit..

All previous value stored in array.....

--------------------

{

if(MarketInfo(Symbol(),MODE_BID)<= minValueIdx)

{

//--- modify order and exit

Print("OrderModify error ",GetLastError());

}

----------------------------------

17995

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++){
:
What happens when i is the last array element [ArraySize(OpenPriceBuy) - 1]?
129

Thanks all...

I'll update latest code... ASAP...

129

fuh....

Now i had ordermodify error 1

for(int cnt=0 ;cnt<OrdersTotal();cnt++)

{

bool resulttemp = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

{

j = maxValueIdx+1;

{

}

{

}

}

}

1836

It is better you Edit and post your code using SRC (besides video icon).
129

`ok... now i see more beautiful.....`
```for(int cnt=0 ;cnt<OrdersTotal();cnt++)
{
bool resulttemp = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
{
j = maxValueIdx+1;
{
}
{

}
}
} ```