Tester only shows sell symbols

 

My EA in tester only shows sells. At the same time the journal registers both sells and buys. 

tester img


Notice the vertical dotted lines which must be interconnected between the buys and the sells during backtesting in the normal situation. Ple explain what's wrong with the settings?? The code is as follows.

#include <Trade/Trade.mqh>

input double Lots = 0.1;

input ENUM_TIMEFRAMES Timeframe = PERIOD_H1;
input int Periods = 100;
input ENUM_MA_METHOD MaMethod = MODE_SMA;

int maHandle;
int barsTotal;
int maDirection;

CTrade trade;

int OnInit(){
   maHandle = iMA(_Symbol,Timeframe,Periods,0,MaMethod,PRICE_CLOSE);
   barsTotal = iBars(_Symbol,Timeframe);
   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason){}

void OnTick(){
   int bars = iBars(_Symbol,Timeframe);
   if(barsTotal < bars){
      barsTotal = bars;
      
      double ma[];
      CopyBuffer(maHandle,MAIN_LINE,1,2,ma);
      
      double lots = (int)(Lots/SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP)) * SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);
      lots = MathMin(lots,SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX));
      lots = MathMax(lots,SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN));
           
      if(ma[1] < ma[0] && maDirection >= 0){
         maDirection = -1;
         
         trade.PositionClose(_Symbol);
         trade.Sell(lots, _Symbol, bid);
      }else if(ma[1] > ma[0] && maDirection <= 0){
         maDirection = 1;
         
         trade.PositionClose(_Symbol);
         trade.Buy(lots, _Symbol, ask);
      }
      
      Comment("\nDirection: ",maDirection,
              "\nma[0]: ",DoubleToString(ma[0],_Digits),
              "\nma[1]: ",DoubleToString(ma[1],_Digits));
   }
}
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
  • www.mql5.com
When creating a custom indicator , you can specify one of 18 types of graphical plotting (as displayed in the main chart window or a chart...
 
SOLVED by reinstall.