Hello
I'm in the task of automatize some trades but what I've got interfere with manual opened trades, I hope someone can point what's missing
my OrderModify:
RefreshRates();
// Calculate Trailing Stop.
if ( Ask <= OrderOpenPrice() - TrailingStart * Point && OrderStopLoss() > Ask + ( TrailingStop * Point ) ) {
Ticket = OrderModify ( OrderTicket(), OrderOpenPrice(), Ask + ( TrailingStop * Point ), OrderTakeProfit(), 0 );
}
---------------
My CloseOrder:
Ticket = OrderClose ( Ticket, OrderLots(), OrderClosePrice(), Slippage, Red );
----------------
I think it's related to magic number, this is my OrderSend:
Ticket = OrderSend ( Symbol(), OP_SELL, Lots, Bid, Slippage, Bid + ( StopLoss * Point ), Bid - ( TakeProfit * Point ), NULL, mymagic, 0, Red);
LastOrder = 0;
How can I avoid the bot to jump on previous opened trades?
Thanks for any help
I'm in the task of automatize some trades but what I've got interfere with manual opened trades, I hope someone can point what's missing
my OrderModify:
RefreshRates();
// Calculate Trailing Stop.
if ( Ask <= OrderOpenPrice() - TrailingStart * Point && OrderStopLoss() > Ask + ( TrailingStop * Point ) ) {
Ticket = OrderModify ( OrderTicket(), OrderOpenPrice(), Ask + ( TrailingStop * Point ), OrderTakeProfit(), 0 );
}
---------------
My CloseOrder:
Ticket = OrderClose ( Ticket, OrderLots(), OrderClosePrice(), Slippage, Red );
----------------
I think it's related to magic number, this is my OrderSend:
Ticket = OrderSend ( Symbol(), OP_SELL, Lots, Bid, Slippage, Bid + ( StopLoss * Point ), Bid - ( TakeProfit * Point ), NULL, mymagic, 0, Red);
LastOrder = 0;
How can I avoid the bot to jump on previous opened trades?
Thanks for any help