I am kind of desperate at the moment. I adapted the code and this is what I try to do:
Like the original version I want Trendy Monster to open a grid, I added individual TP and SL for the grid. The first pending order, which actual triggers the grid shall close at the SL and then all grid orders shall be deleted. But it doesn´t work somehow.
Code: Select all
if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP || OrderType() == OP_BUYLIMIT)
{
if (OrderComment() == TradeComment) // initial trade, if it hits SL all orders get deleted
{
//TP
if (bid >= take && !closeEnough(take, 0) ) CloseThisTrade = true;
//SL
if (bid <= stop && !closeEnough(stop, 0) )
{
deletePendings = true;
closeAllTrades(OrderSymbol(),OP_BUYSTOP);}
CloseThisTrade = true;
}
}// initial trade
Maximilian