Transfer and exit problem from EA to EL

Trying to transfer a buy signal from ea to multicharts on daily bars

Using 10 bars exit

but whn there are subsequent buy similar buy signals before the first buy exit within 10 bars, all the subsequent buy signals exit together on the 10 bars rather than exit individually 10 bars from their entries

Would be apprecciate anyone would correct the code so all subsequent similar signals all exit 10 bars from their individual exit


if c<average(c,50) and stoch(c,14)<30 then 
buy ("LE1") 1 contract next bar at market; 
  
if TimeToMinutes(date) - TimeToMinutes(OpenEntrydate(0)) >= 10 
then sell from entry ("LE1") 1 contract total next bar at market;