EA not placing shorts in live trading.

 

I am quite new to coding in mql5 and have written my own EA. 

It seems to work fine in the strategy tester and places both long and short trades. 

But in live trading it only places long trades and has not placed any shorts. 

I suspect it has something to do with my code for calculation lot size based on a % of my equity. 

Can someone tell me if there is something wrong with this code or does anyone have any suggestions why my EA works in the tester but doesn't take shorts in live trading?

 // Calculate position volume based on account equity
      if (SymbolInfoString(_Symbol,SYMBOL_CURRENCY_BASE) == AccountInfoString(ACCOUNT_CURRENCY)){
         double lotSize = SymbolInfoDouble (_Symbol, SYMBOL_TRADE_CONTRACT_SIZE);
         double symbolPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
         double lotPrice = symbolPrice / lotSize;
         double slPercentage = (stopLossAtEntry - symbolPrice) / (symbolPrice / 100);
         double accountEquity = AccountInfoDouble(ACCOUNT_EQUITY);
         double dollarsToRisk = accountEquity / 100 * EquityRisked;
         double lotsPerTradeCalculator = (lotPrice * (slPercentage/100) / dollarsToRisk);
         double lotsPerTrade = NormalizeDouble(1/lotsPerTradeCalculator, 2);
         
         // Place short trade
         if (PositionSelect(_Symbol) == false){ // If no open position
            trade.Sell(lotsPerTrade, _Symbol, 0, 0, takeProfit, "Short Bollinger Entry");
            }
         }

Any help would be much appreciated.