거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

TradeProtector-1.0 - MetaTrader 4용 expert

조회수:
29366
평가:
(7)
게시됨:
2009.09.30 05:48
업데이트됨:
2016.11.22 07:32
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

If you have placed order and suddenly have to leave: don't panic! This EA will set initial Stop Loss (if you haven't done it yet), and after your position will reach settable profit threshold, TradeProtector will start to apply proportional Trailing Stop.

The idea of this EA came to me after the following situation: I have opened a position, but suddenly had to leave. I have set reasonable SL, but what happened:

During my absence, my position reached 40 pips profit, then market reversed and instead of any gain, the initial SL has been hit - causing small - but unnecessary lose.

I don't like trailing stops, because when the trend is nice, let's say we have after few hours 120 pips profit. My trailing stop set to 35 pips, which was reasonable at the beginning, now can kill this nice winning trade if there would be 38% retracement.

That's why I prefer proportional trailing stop, given by the formula:

ProportionalSL = | CurrentPrice - OrderOpenPrice | x Ratio - Spread

Let's say I will set the Ratio to 55%. In the example above I would get about 15 pips profit, which is better than nothing, but if the trend would continue, 40% retracement (0.38 Fib) - no matter what would be reversal point - would not stop my trade.

There is also a part which I am not certain of, but by default it is switched off. I call it Escape - when your trade reached an impressive lose, you usually would be happy to close it with even very small profit or even some - less impressive lose. So you can set a 'disturbing' level of lose after which you would like to activate this function, then profit or lose you would be happy to close that trade with. In most cases - if the stop loses are properly set, this will not be necessary, but I decide to leave it in the code, just in case...


So here we go:

Put this EA on M1 or M5 chart.

Set :

  • logging=1 - if you want logs in MQL4\Files directory;
  • nTrailingStop [pips] - initial trailing stop. It will be used until your trade will reach profit = nPropSLThreshold;
  • nPropSLThreshold [pips] - after reaching this profit proportional trailing stop will be used;
  • dPropSLRatio [decimal] - multiplying factor ( PropSL = Profit * dPropSLRatio - Spred );
  • nUseEscape [ 1 or 0 ] - escape misplaced trades as soon as they reach some minimal profit;
  • nEscapeLevel [pips] - lose size after which we want our trade to terminate as soon as it will reach next high;
  • nEscapeTP [pips] - take profit level in pips (you can set to negative value - then it will be a lose that you would be happy to get, in the case your trade reached some impressive negative pips value).

ChartPlusChart V2 ChartPlusChart V2

Program for logging of non-market quotations from brokerage companies with MetaTrader platform.

Trading Simulator 2 Trading Simulator 2

The program-simulator v.2 for perfecting strategy, testing of indicators and trainings of trading skills.

ImpulseOsMA ImpulseOsMA

Индикатор MACD, совмещённый с гистограммой MACD, усовершенствованный для использования импульсной торговой системы, предложенной А. Элдером.

Yet another MA Angle counting Yet another MA Angle counting

An alternative version for counting MA Angle.