Price and Stop calculations for StopOrders

 
Hi,
Does this look right to you?
I'm thinking mostly on the price & stoplevel calculations. This code seems to work ok but 'variations' work even better...
Does the check on OpenPrice look ok ?
I have assumed that the final stops should be referenced to the OpenPrice and not to Ask ?
Its part of a scalper and I get 400% more profit when referenced to Ask but I guess its just a matter of readjusting the stops...

In short: do you see anything real bad in this BuyStop function ?

//---------- TryToBuy Function ----------------------
void  TryToBuy(double OpenPrice, int Dir)
   {
   if (Dir == 4 && (TicketBuy == 0) && (TicketSell == 0))
      {  
      double StopLevel = 20;//MarketInfo(Symbol(), MODE_STOPLEVEL);             
      //Limit entry price and stops to minimal values:
      if( (OpenPrice - Ask) <= (StopLevel * Point)) return;//Nothing to do, Wrong price!
      if(StopLoss   <= StopLevel) StopLoss   = StopLevel;//Closest permitted StopLoss
      if(TakeProfit <= StopLevel) TakeProfit = StopLevel;//Closest permitted TakeProfit      
      
      //Get Lots and adjust to specs:
      double LotsToSend = LotSize();
      double MarketMinLot = MarketInfo(Symbol(), MODE_MINLOT);
      double MarketLotDigits;
      if(MarketMinLot == 0.1)  MarketLotDigits = 1;
      if(MarketMinLot == 0.01) MarketLotDigits = 2;
      if(LotsToSend < MarketMinLot) LotsToSend = MarketMinLot;    //Minimum permitted lots    
      //
      double SLtoSend = OpenPrice - (StopLoss * Point);           //SL points to price
      double TPtoSend = OpenPrice + (TakeProfit * Point);         //TP points to price
      OpenPrice  = NormalizeDouble(OpenPrice, Digits);            //Normalize Price
      SLtoSend   = NormalizeDouble(SLtoSend, Digits);             //Normalize SL
      TPtoSend   = NormalizeDouble(TPtoSend, Digits);             //Normalize TP
      LotsToSend = NormalizeDouble(LotsToSend, MarketLotDigits);  //Normalize Lots
      int Ticket = OrderSend(Symbol(), OP_BUYSTOP, LotsToSend, OpenPrice, Slippage, SLtoSend, TPtoSend, "", Magic, 0, Blue);
      }         
   return;
   }
//----------------------------------------------------
Reason: