Sell orders on expert advisor not working

 

I have an expert that executes orders based on external inputs from text file. Expert reads the file as intended and sends buy orders. However, sell orders don't work. What could be the problem? Auto trading is on and is set to both long and short.

Important to say: expert advisor works normally on a different computer with a different account.

Manual trades work normally.

Files:
Izrezak.PNG  63 kb
 
mario_400: What could be the problem?

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked, so we can't see your machine.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't see your broken code.

Always post all relevant code (using Code button) or attach the source file.

What does the log files say?

 
if (BUY_SEL == "BUY")
      {
      lotSize = (AccountBalance()*riskPercentage/100)/(SL_distance*10);
      stopLoss = Ask-SL_distance*0.0001;
      takeProfit = Ask+SL_distance*Ratio*0.0001;
      ticket = OrderSend(_Symbol, OP_BUY, lotSize, Ask, 100, stopLoss, takeProfit, NULL, 12345);
      magic=12345;
      }
      else if (BUY_SEL == "SEL")
      {
      lotSize = (AccountBalance()*riskPercentage/100)/(SL_distance*10);
      stopLoss = Bid+SL_distance*0.0001;
      takeProfit = Bid-SL_distance*Ratio*0.0001;
      ticket = OrderSend(_Symbol, OP_SELL, lotSize, Bid, 100, stopLoss, takeProfit, NULL, 12345);
      magic=12345;
      }

Explanation from the developer: Program works by tracking a chart in external program and sending a signal through txt document. Expert in meta trader reads said file from common terminal folder and saves its content in a string variable. That part of the program worksexpert opensreadsand closes the file normallyBased on that signalexpert must enter buy or sell order with conditions set by the client which are not relevant for the working of the expertBuy orders are always executed as intendedSell orders don't work but only on client's computer regardless of account or broker usedOn computer on which the expert was developed and tested everything worksSettings on client's computer are set correctlyboth long and short positions are allowed and DLL inputs are not requiredSection of code that governs sending orders is attached below and is located in OnTick void function.

All variables are global and are defined correctly. lotSize, stopLoss, and takeProfit values are calculated based on inputs from client. Logs reports no errors

Worth noting is that client can manually enter any order and doesn't have leverage problems.

I can provide entire code if necessary.
 
mario_400 #:

      ticket = OrderSend(_Symbol, OP_BUY, lotSize, Ask, 100, stopLoss, takeProfit, NULL, 12345);

Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
          General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon.