Forum

orderStopLoss() = 1

Hi, I have a problem in coding Trailing Stop Loss . if (OrderSelect(u,SELECT_BY_POS,MODE_TRADES)) { double stoploss = OrderStopLoss(); int ticket = OrderTicket(); double priceopen = OrderOpenPrice(); double takeprofit = OrderTakeProfit(); int typ = OrderType(); Alert ("stoploss:",stoploss,"

How to make an EA not lose data after MT4 shut down?

I have an idea for coding an EA, but at very first stage I found out that it would start making losses if by any reason MT4 would be switched off and on again. I need my EA to remember a set of data (an array to be specific) no matter what. I couldn't find any solution anywhere on the internet. My

DeleteOrder problem

Hi! I have a problem with DeleteOrder function. My EA places series of 18 pending orders and assigns order ticket numbers to the array. Program should delete them later on when it decides that they are in a wrong place, and put new ones in a valid place. The problem is that new orders are placed but