236

I am noticing when new orders are open on the same pair that the TakeProfit point for all orders are adjusted to the same point causing some orders to takeprofit at a loss.

So how would I get what the current take profit point is for a certain open pair? That way I could evaluated it verse what the new orders take profit point should be and adjust the takeprofit for the pair to which ever is greater.

Moderator
10645

Tony Chavez:

I am noticing when new orders are open on the same pair that the TakeProfit point for all orders are adjusted to the same point causing some orders to takeprofit at a loss.

So how would I get what the current take profit point is for a certain open pair? That way I could evaluated it verse what the new orders take profit point should be and adjust the takeprofit for the pair to which ever is greater.

Maybe you are suffering from FIFO?
236

Both things are an issue. Just the takeprofit portion seems manageable where FIFO I am just stuck with.
Moderator
10645

FIFO is a completely stupid rule as far as I am concerned. What difference does it make which are closed first? Just bureaucratic nonsense.

If you are trading manually, there is not much you can do unless they are all the same lot size and you could swap the TPs.

If with an EA, it would require some coding to make sure that the first opened will be the first closed.

236

Keith Watford:

FIFO is a completely stupid rule as far as I am concerned. What difference does it make which are closed first? Just bureaucratic nonsense.

If you are trading manually, there is not much you can do unless they are all the same lot size and you could swap the TPs.

If with an EA, it would require some coding to make sure that the first opened will be the first closed.

I am writing an EA and in the end I will have it do something like this. Code is for logic purpose only not actual working code.

double CurrentTP = CheckOpenOrdersTP(Symbol){

if(CurrentTP >= NewTP){

TP = CurrentTP;

} else{

TP = NewTP;

}

236

Anyone have any thoughts on who to get the current TakeProfit point for a pair?
15934

 Tony Chavez: Anyone have any thoughts on who to get the current TakeProfit point for a pair? Not who, how.It's called an OrderSelect loop. Don't double postUsing OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum