change logic in ea

 

I have one ea in which logic is to exit trade if opposite signal come. but I want to now open buy and sell order at a time what changes I need to do

      // Exit any trades in opposite direction.
      //---------------------------------------
   
      if (bullish)
         ExitAll(SHORT);
     
      else if (bearish)
         ExitAll(LONG);
      // Check for entries and if entry condition exists, do a trade.
      //-------------------------------------------------------------
   
      if (lastTradeTime != Time[THIS_BAR])
      {
         if (bullish)
         {
         if (DoTrade(LONG, CalculateLots(Stop, risk), Stop, TakeProfit, ORDER_COMMENT))
             lastTradeTime = Time[THIS_BAR];
         }
         else if(bearish)
         {
         if (DoTrade(SHORT, CalculateLots(Stop, risk), Stop, TakeProfit, ORDER_COMMENT))
             lastTradeTime = Time[THIS_BAR];
         }
         
      }
      
   }  // end if (currTimeStamp != Time[0])

   return(0);
}
 
kcfve123: I have one ea in which logic is to exit trade if opposite signal come. but I want to now open buy and sell order at a time what changes I need to do
remove the exit logic.
 
      // Exit any trades in opposite direction.
      //---------------------------------------
   
      if (bullish)
         ExitAll(SHORT);
     
      else if (bearish)
         ExitAll(LONG);
      // Check for entries and if entry condition exists, do a trade.
      //-------------------------------------------------------------
   
      if (lastTradeTime != Time[THIS_BAR])
      {
         if (bullish)
         {
         if (DoTrade(LONG, CalculateLots(Stop, risk), Stop, TakeProfit, ORDER_COMMENT)&&(DoTrade(SHORT, CalculateLots(Stop, risk), Stop, TakeProfit, ORDER_COMMENT)))
             lastTradeTime = Time[THIS_BAR];
         }
         else if(bearish)
         {
         if (DoTrade(SHORT, CalculateLots(Stop, risk), Stop, TakeProfit, ORDER_COMMENT)&&(DoTrade(LONG, CalculateLots(Stop, risk), Stop, TakeProfit, ORDER_COMMENT)))
             lastTradeTime = Time[THIS_BAR];
         }
         
      }
      
   }  // end if (currTimeStamp != Time[0])

   return(0);
}

I don't want to remove exit logic instead I done above changes. Now I need to set logic as below

If bullish take profit of short should be at the rate where buy order is having stoploss & vice a versa for bearish scenario.

I am setting take profit at very high value so that my order will get closed due to exit logic. How I can do this. I see that stoploss is set in the order due to modify logic.