Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

Missing Stop Loss and Take Profit Setter - sistema esperto per MetaTrader 5

Kenichiro Sakamoto
Kenichiro Sakamoto
5 (2)
Sono Kenichiro Sakamoto, lo sviluppatore di FXEA365, uno studio che crea Expert Advisor trasparenti e basati su regole per MetaTrader 5.
Visualizzazioni:
99
Valutazioni:
(1)
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

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.

Prop Firm Guard Prop Firm Guard

Closes every position before your prop-firm daily or maximum loss limit is reached and keeps the account flat afterwards. Works next to any EA or manual trading. It never opens trades.

Risk Lot Calculator Risk Lot Calculator

Drop it on the chart at your stop-loss level and get the exact lot for your risk. Correct for gold, indices, crypto and cross pairs. It never opens trades.