Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
8057
Rating:
(10)
Published:
Updated:
Trailing Sl.mq5 (2.99 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Copy these into any EA you are busy coding and you"ll have a trailing SL.
The only things you'll need to change would probably be InpMagic for your magic number or you could just copy my code as is , Remember to add COrderinfo ord; and CPositionInfo pos;

On tick function Trailing sl

Inputs

Buffers for each hour (binary) and an hour buffer from 0-23 - for data collection purposes Buffers for each hour (binary) and an hour buffer from 0-23 - for data collection purposes

Prototype for data collection. Dummy buffers for the data window (for data collection purposes) for the hour of the day, and an additional buffer for the hour of the day. Comments the hour of the day.

Profit labels for closed trades (deals) Profit labels for closed trades (deals)

Creating profit labels on deals (closed trades) which also show in the strategy tester

Script to Map Market Watch Symbols Based on Similarity Script to Map Market Watch Symbols Based on Similarity

This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. It is ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. This is a customizable starting point to adapt to any specific needs.

BollingerBandsEA BollingerBandsEA

BollingerBandsEA trades according to Bollinger Bands.