I would like to close an order at different levels. Example I close half of my order at takeprofit1 and the remainder at takeprofit2 using something like this:
The obvious problem is that when price hits my TakeProfit1 it will try to close on every new tick eventually closing the entire order. Is there a way to have this only perform the action once?
I realize I could open two separate orders with different take profits but I'd prefer to learn how to do it differently if there is another way. I like the idea of hiding my take profits from the broker. Any help or advice is appreciated.
Inserted Code
if (OrderType()==OP_BUY)
{
if (Bid > OrderOpenPrice() + TakeProfit1)
{
OrderClose( 12345, 0.5, Bid, 2 );
}
if (Bid > OrderOpenPrice() + TakeProfit2)
{
OrderClose( 12345, 0.5, Bid, 2 );
}
} I realize I could open two separate orders with different take profits but I'd prefer to learn how to do it differently if there is another way. I like the idea of hiding my take profits from the broker. Any help or advice is appreciated.