consider spreads and comission

 

hi guys

i want to code an EA that when open a Buy/Sell position with 60 point profit. if the position goes to -20 point profit then open a position In the opposite direction of first position with 60 point profit

the code is hear:

if(orderType==OP_BUY)
        ticket = OrderSend(Symbol(),orderType,lots,openPrice,5,stopLossPrice,takeProfitPrice,"AFKARIAUS ",MagicBuy,0,clrGreen);
if(orderType==OP_SELL)
        ticket = OrderSend(Symbol(),orderType,lots,openPrice,5,stopLossPrice,takeProfitPrice,"AFKARIAUS ",MagicSell,0,clrGreen);

for(int i=OrdersTotal()-1; i>=0; i--)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicBuy && OrderType()==OP_BUY)
                BuyTicket=OrderSend(Symbol(),OP_SELLSTOP,lots,OrderOpenPrice()-20*Point,5,OrderOpenPrice()+60*Point,OrderOpenPrice()-20*Point-60*Point,"AFKARIAUS",MagicBuy+1,0,clrBlue);

         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicSell && OrderType()==OP_SELL)
                  SellTicket=OrderSend(Symbol(),OP_BUYSTOP,lots,OrderOpenPrice()+20*Point,5,OrderOpenPrice()-60*Point,OrderOpenPrice()+20*Point+60*Point,"AFKARIAUS",MagicSell+1,0,clrBlue);
     }

 every thing is ok

but when test with real money there is Comission,Spreads and Swap.and i dont know what should i do

please help me 

thanks

 
is there anyone to help me???
Reason: