# Is Your Trail Stop Smart Enough?

Let’s evaluate the 2 trades that transpired today.

4% gains for the day, not bad, right?

The two routines, 95 End Line Trader and 94 Green River Trader picked the best spots.

What was missing? The free trade.

Let me explain.

Say, I had widened my idea from one specific routine (93 Weight Breaker) to all the trades – namely to adjust the stop loss to 1 pips positive upon exceeding 8 pips in gainsÂ  to cover the commission…

I already have the following trail stop piece, that puts a trail stop 1/2 fluctuation size back from the current 30-minute high/low upon exceeding 20 pips in profits…

for(i=OrdersTotal()-1; i>=0 ; i–){
{
Print(“Access to orders list failed with error (“,GetLastError(),”)”); break;
}

if (OrderType() == OP_BUY && OrderMagicNumber()!=exempt_magic_number )
if (iHigh(symbol,30,0)-200*Point > OrderOpenPrice() && (iHigh(symbol,30,0)-FSize/2*10*Point > OrderStopLoss() || OrderStopLoss()==0) )
{
Print(“bUY sTOP lOSS ATTEMPT “, OrderTicket());
if (!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(iHigh(symbol,30,0)-FSize/2*10*Point,6), OrderTakeProfit(), Red))
Print(“Error setting Buy trailing stop: “, GetLastError());
}
if (OrderType() == OP_SELL && OrderMagicNumber()!=exempt_magic_number)
if (iLow(symbol,30,0)+200*Point < OrderOpenPrice() && (iLow(symbol,30,0)+FSize/2*10*Point < OrderStopLoss() || OrderStopLoss()==0) )
{
Print(“sELL sTOP lOSS ATTEMPT “, OrderTicket());
if (!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(iLow(symbol,30,0)+FSize/2*10*Point,6), OrderTakeProfit(), Red))
Print(“Error setting Sell trailing stop: “, GetLastError());
}}

What if I added the free trade…?

if (OrderType() == OP_BUY)
if ((iHigh(symbol,5,0)-FSize/4*10*Point> orderstoploss || (iHigh(symbol,5,0)-FSize/4*10*Point> OrderOpenPrice() && orderstoploss==0) || ( iHigh(symbol,5,0)-10*Point> OrderOpenPrice() && TimeCurrent()-OrderOpenTime()>=18000)) && (iHigh(symbol,5,0)-FSize/3*10*Point< OrderOpenPrice())){
Print(“bUY sTOP lOSS ATTEMPT “, OrderTicket());
if (!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderOpenPrice()+10*Point,6), OrderTakeProfit(), Red))
Print(“Error setting Buy trailing stop: “, GetLastError());
}
if (OrderType() == OP_SELL)
if ((iLow(symbol,5,0)+FSize/4*10*Point < orderstoploss || (iLow(symbol,5,0)+FSize/4*10*Point<OrderOpenPrice() && orderstoploss==0) || (iLow(symbol,5,0)+10*Point<OrderOpenPrice() && TimeCurrent()-OrderOpenTime()>=18000)) && (iLow(symbol,5,0)+FSize/3*10*Point>OrderOpenPrice())) {
//
Print(“sELL sTOP lOSS ATTEMPT “, OrderTicket());
if (!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(OrderOpenPrice()-10*Point,6), OrderTakeProfit(), Red))
Print(“Error setting Sell trailing stop: “, GetLastError());
}

if (OrderType() == OP_BUY && OrderMagicNumber()!=exempt_magic_number )
if (iHigh(symbol,5,0)-FSize/2*10*Point > OrderStopLoss() && (iHigh(symbol,5,0)-200*Point > OrderOpenPrice() || (iHigh(symbol,5,0)-200*Point > OrderOpenPrice() && OrderStopLoss()==0)) )
{
Print(“bUY sTOP lOSS aTTEMPT “, OrderTicket());
if (!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(iHigh(symbol,5,0)-FSize/2*10*Point,6), OrderTakeProfit(), Red))
Print(“Error setting Buy trailing stop: “, GetLastError());
}
if (OrderType() == OP_SELL && OrderMagicNumber()!=exempt_magic_number)
if (iLow(symbol,5,0)+FSize/2*10*Point < OrderStopLoss() && (iLow(symbol,5,0)+200*Point < OrderOpenPrice() || (iLow(symbol,5,0)+200*Point <OrderOpenPrice() && OrderStopLoss()==0)) )
{
Print(“sELL sTOP lOSS aTTEMPT “, OrderTicket());
if (!OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(iLow(symbol,5,0)+FSize/2*10*Point,6), OrderTakeProfit(), Red))
Print(“Error setting Sell trailing stop: “, GetLastError());
}