Error 130 may be due to a lack of braces after OrderSelect()
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { Print ("Real Ticket: ",OrderTicket()); if (OrderMagicNumber()==MagicNumberLong) if (OrderSymbol()==Symbol()) if (OrderType()==OP_BUY) { if(Ask-OrderTakeProfit()>Trail*Point) TrailingStop(OrderTicket());
oldticketnumber = OrderTicket(); if (oldticketnumber > buyticketnumber) buyticketnumber = oldticketnumber; //Sets buyticketnumber to newest order } } }
I thought about that as well but it has to do with the minimum distance to SL and TP. I use the highest high and lowest low of the last x candles on a 1M chart. Sometimes the price range is just too small. I temporarily solved it by setting a fixed number of pips.
datas_brother: I thought about that as well but it has to do with the minimum distance to SL and TP. I use the highest high and lowest low of the last x candles on a 1M chart. Sometimes the price range is just too small. I temporarily solved it by setting a fixed number of pips.
Error 130 may be due to a lack of braces after OrderSelect()
{
Print ("Real Ticket: ",OrderTicket());
if (OrderMagicNumber()==MagicNumberLong)
if (OrderSymbol()==Symbol())
if (OrderType()==OP_BUY)
{
if(Ask-OrderTakeProfit()>Trail*Point)
TrailingStop(OrderTicket());
oldticketnumber = OrderTicket();
if (oldticketnumber > buyticketnumber)
buyticketnumber = oldticketnumber; //Sets buyticketnumber to newest order
}
}
}
I thought about that as well but it has to do with the minimum distance to SL and TP. I use the highest high and lowest low of the last x candles on a 1M chart. Sometimes the price range is just too small. I temporarily solved it by setting a fixed number of pips.
Rather than guess, try using
https://book.mql4.com/appendix/limits
Rather than guess, try using
https://book.mql4.com/appendix/limits
The last time I did any programming Ronald Reagan was president. It's taking me a bit to get back in to it. I appreciate the help.