Rejoignez notre page de fans
![Experts](https://c.mql5.com/i/code/expert.png)
TradeProtector-1.1 - Automatic Stop Loss and proprotional Trailing Stop (updated version) - expert pour MetaTrader 4
- Vues:
- 32479
- Note:
- Publié:
- 2009.10.06 06:40
- Mise à jour:
- 2014.04.21 14:54
-
Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance
Updated version of the:
https://www.mql5.com/en/code/9238
List of fixes:
- Added SYMBOL (currency pair) checking. Version 1.0 was processing all orders, no matter what currency pairs was there. Currently this EA is only processing orders of the same symbol.
If you want to use it for - let's say EURGBP and EURUSD - attach trade_protector-1.1 to the charts of the respective pairs.
- Fixed minor calculation problem for trailing stops on SELL orders (the spread value was unnecessarily added in the trailing stop value calculation formula).
Changes/Fixes in version 1.2:
- changed algorithm: if there is no SL, EA sets nInitialSL (pips) from the current price, then nTrailingStop is used as normal trailing stop until nPropSLThreshold profit (in pips) is reached. From that point proportional SL is used: (Buy/Sell)
SL = OrderOpenPrice() +/- dPropSLRatio(Bid/Ask - OrderOpenPrice()) -/+ spread
- 3 logging level are now meaningful: 0 - no logging, 1 - (default) only events (change SL) are logged, 2 - additional log file for diagnostic
The settable parameters are:
extern int logging=1;
//logging=0,1,2 - logging level
extern int nInitialSL=15;
// inital SL
extern int nTrailingStop=35;
//nTrailingStop [pips] - initial trailing stop. It will be used until your trade will reach profit = nPropSLThreshold. If you don't want trailing stop, set to a big value (bigger then nInitialSL + nPropSLThreshold)
extern int nPropSLThreshold=12;
//nPropSLThreshold [pips] - after reaching this profit proportional trailing stop will be used
extern double dPropSLRatio=0.35;
//dPropSLRatio [decimal] - multiplying factor ( PropSL = Profit * dPropSLRatio - Spred )
extern int nUseEscape=0;
//nUseEscape [ 1 or 0 ] - escape misplaced trades as soon as they reach some minimal profit
extern int nEscapeLevel=0;
//nEscapeLevel [pips] - lose size after which we want our trade to terminate
//as soon as it will reach next high
extern int nEscapeTP=35;
//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)
extern int nSleep=0;
//delay after new bar
extern int nSlip = 2;
//maximum price slip allowed
![Yet another MA Angle counting](https://c.mql5.com/i/code/indicator.png)
An alternative version for counting MA Angle.
![ImpulseOsMA](https://c.mql5.com/i/code/indicator.png)
Индикатор MACD, совмещённый с гистограммой MACD, усовершенствованный для использования импульсной торговой системы, предложенной А. Элдером.
![GG-RiverFlow](https://c.mql5.com/i/code/indicator.png)
This indicator informs you about the depth of the trend.
![v35260_Colored](https://c.mql5.com/i/code/indicator.png)
Продолжение темы "..взгляд по другому...", на этот раз работаем с Haiken Ashi.