coding problem. - page 3

 
string   TimeTrade = "00:00";
   StartTime  = StrToTime(TimeTrade) + TimeZone*3600;

This sets StartTime to TimeZone number of hours after the EA was compiled not after the start of the day.

 if(Bars < 1) {Print("Not enough bars for this strategy"); return(0);}

Can never happen.

Insert alerts in the code

 ticket = OrderSend(Symbol(),OP_SELLSTOP,Lotsi,NormalizeDouble(SellPrice,digit), Slippage,
                     NormalizeDouble(SellStop,digit),Profit,"SELL",Magic,0,Red);
  1. You don't show all the code, so we have to guess.
  2. Slippage is in Points. If you mean three pips on a five digit broker, that must be 30. Likewise any other external pip variables.
  3. The build in variable is Digits, so we have no idea what normalize(,digit) is.
  4. You don't check ticket for being negative and print out or alert any errors so any number of things could be wrong. Print all the variables, lots, price, SL, TP, and ASK/BID
  5. If you are running in the tester, Alerts become Prints, in the journal tab.
     if ( OrderOpenDate() < StrToTime(TimeToStr( StartTime,TIME_DATE))) 
      { PendOrdDel(); if( TradePeriod > 0 )CloseOrdbyTime(); }
You can not use OrderOpenDate() or any other ones until you perform a orderSelect()