Mastering AutoSLTP for MetaTrader 5: Your Go-To Tool for Setting Stop Loss and Take Profit

Mike 2017.11.03 21:23 31 0 0
Attachments

Author of the idea: Vladimir Khlystov, mq5 code author: barabashkakvn.

Are you tired of manually setting Stop Loss and Take Profit for all your open trades? Look no further! The AutoSLTP tool is here to streamline your trading experience on MetaTrader 5. This handy assistant automatically manages your Stop Loss and Take Profit levels based on settings specified in an external configuration file.


Configuring Your AutoSLTP

First things first, you’ll need to create a configuration file. Save it as AutoSLTP.txt in your data folder at [data folder]/MQL5/Files/AutoSLTP/AutoSLTP.txt.


Writing the Configuration File

Each line in your configuration file should detail a specific symbol and position type. The format you’ll use is as follows:

[symbol name]*[position type]*[stop loss]*[take profit]


Understanding the Parameters

  • [symbol name] - This is the name of the currency pair or asset you are trading;
  • [position type] - This indicates whether you’re opening a buy or sell position. Use POSITION_TYPE_BUY for buys and POSITION_TYPE_SELL for sells.
  • [stop loss] - This is the Stop Loss value, and it should be entered as an integer.
  • [take profit] - This is the Take Profit value, also entered as an integer.


Example of a Configuration File

AUDCAD*POSITION_TYPE_BUY*50*96
AUDCAD*POSITION_TYPE_SELL*40*46
USDJPY*POSITION_TYPE_SELL*80*38

With this setup, you'll have your Stop Loss and Take Profit levels automatically configured for each trade, giving you more time to focus on your strategy and less on manual adjustments!

List
Comments 0