building this for custom indicator..but its not taking trades what can be the error?

 
//+------------------------------------------------------------------+
//|                                                         eeex.mq4 |
//|                        Copyright 2022, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   
  
  //create a string variable of signal
  
  string signal = "";
  
  //set all buffers
  
    // has a value on buffer 1 (array 0)
  
    double Buy=iCustom(NULL,0,"SMPRO 7.00.ex4",0,1);
      Print("up arrow value ",Buy);
   
   
   
    // has a value on buffer 2 (array 1)
    
    
    double Sell=iCustom(NULL,0,"SMPRO 7.00.ex4",1,1);
      Print("dn arrow value ",Sell);
  
  //setting signals
  
  if(Buy!=EMPTY_VALUE)
  {
  signal = "buy";
  }
  
 if(Sell!=EMPTY_VALUE)
  {
  signal = "sell";
  }
    
  

  
  //has a value on buffer 2 (array 0)
  
  
  //Buy 10 Microlots
  if (signal=="buy" && OrdersTotal()==0)
  OrderSend(Symbol(),OP_BUY,0.01,Ask,3,0,Ask-150*_Point,NULL,0,0,Green);
  

 //Sell 10 Microlots
  if (signal=="sell" && OrdersTotal()==0)
  OrderSend(Symbol(),OP_SELL,0.01,Bid,3,0,Bid-150*_Point,NULL,0,0,Red);
    
     
     }
 
Watson Dyton Mulenga:

Anything under Experts / Journal tab?

 
Its running properly but I want it to close buy position once sell signal appears..any help on rhis
 
  1. Watson Dyton Mulenga: building this for custom indicator..but its not taking trades what can be the error?

    Indicators can not trade.-

  2. Watson Dyton Mulenga # I want it to close buy position once sell signal appears..any help on rhis

    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
              No free help (2017)