Is Your Trail Stop Smart Enough?

Let’s evaluate the 2 trades that transpired today.

Trail

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–){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false)
{
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());
}

 

 

Trade 1:

Trail01

With the Free Trade add on, and with making this routine exempt from the Fluctuation Stop Loss Fitter, the trade would had gone to its target making 38.4 pips in gains instead of 11.4 pips, yielding $952 instead of $282. The maximum heat on this trade was 2.2 pips because of the otherwise perfect entry.

Trail02

Now, for the second trade, which I closed prematurely, the alternate route could had been the following: once the free trade is running there is no danger of losing on the trade. Two possible outcomes: when changing nothing, the 1/2 fluctuation trail stop could had closed the trade at 1.1676, or 16 pips away from the high, for 25 pips profits instead of 3.5 pips, which would had brought the profits from 185.15 to 1,322.50 – or route 2, on top of the free trade, better target choice – the Guard rail, fluctuation Maximum away would had brought the total move length to 39.9 pips, or the profits to 2,110.71.

Needless to say, this auto trading routine had worked perfectly also in terms of getting the entry right, which was 1 pip below the Green River high. The heat was less than 1.5 pips.

$3,062.71 was the potential gain for the 2 trades without increasing their initial sizes, which comes out to be about 26% gains for the day.

Trail03