Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Twitter üzerinde bulun!
Fan sayfamıza katılın
Kodu ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Kodu beğendiniz mi? MetaTrader 5 terminalinde deneyin
Uzmanlar

Missing Stop Loss and Take Profit Setter - MetaTrader 5 için uzman

Kenichiro Sakamoto
Kenichiro Sakamoto
5 (2)
Ben Kenichiro Sakamoto, MetaTrader 5 için şeffaf ve kural tabanlı Expert Advisor'lar geliştiren FXEA365 stüdyosunun geliştiricisiyim.
Görüntülemeler:
6
Yayınlandı:
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

This Expert Advisor checks the open positions on every tick and every 5 seconds. When a position has no stop loss, a stop loss is placed at the set number of pips from the open price, and when it has no take profit, a take profit is placed in the same way. Stop levels that already exist are never changed.

The check can be limited to the chart symbol or applied to all symbols, and a magic number filter can limit it to manual trades or to the trades of one Expert Advisor. The chart comment shows the settings, the number of positions in scope, the positions still without stops and the number of positions changed since the start.

Fig. 1. The utility on a EURUSD H1 chart

Input parameters

  • InpSLPips - stop loss distance from the open price in pips; 0 means that no stop loss is added.
  • InpTPPips - take profit distance from the open price in pips; 0 means that no take profit is added.
  • InpAllSymbols - check the positions of all symbols; when false only the chart symbol is checked.
  • InpMagic - magic number filter: -1 checks all positions, 0 only manual trades, another value only the trades with that magic number.

Notes

If the price has already moved past the calculated level, or the level is closer to the price than the stop level of the broker, that level is skipped and the position is checked again later. One pip is 10 points on 3 and 5 digit quotes and 1 point on other symbols. Failed requests are written to the Experts log with the description of the trade server return code.

Spread Spike Histogram with Moving Average Spread Spike Histogram with Moving Average

Separate window indicator that draws the spread of every bar as a histogram with its moving average and colors the bars where the spread is far above normal or above a fixed ceiling.

Economic News Window Flag for Pausing Expert Advisors Economic News Window Flag for Pausing Expert Advisors

Utility Expert Advisor that reads the built-in economic calendar and sets a terminal global variable to 1 around important events, so other Expert Advisors can skip new entries during the news.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.