int TrailingStopLong()
{
//adjust the stop only when the trade is in profit
if(TradeIsOpen and TradeProfit > 0) //////TradeStopLimit = max(TradeStopLimit,LL(3));
//place the stop at 40 points from current price//bars
TradeStopLimit = max(TradeStopLimit, LL(4));
//plot a line to make the stop limit visible
plot("stop", TradeStopLimit, MINV, BLACK);
//RETURN 0 FOR CHECKING THE LIMITS
return 0;
}


int TrailingStopShort()
{
//adjust the stop only when the trade is in profit
if(TradeIsOpen and TradeProfit > 0)
//place the stop at 40 points from current price//bars
TradeStopLimit = max(TradeStopLimit, HH(4));
//plot a line to make the stop limit visible
plot("stop", TradeStopLimit, MINV, BLACK);
//RETURN 0 FOR CHECKING THE LIMITS
return 0;
}