Watch how to download trading robots for free
Find us on Telegram!
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
Experts

Profit labels for closed trades (deals) - expert for MetaTrader 5

Views:
4343
Rating:
(4)
Published:
2024.12.21 01:32
Updated:
2024.12.23 14:19
Profit Labels.mq5 (18.38 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

A simple demonstration to show how it's possible to code profit and loss labels for the most recently closed deals. 

This EA will place dummy trades, so you can see how it looks in the strategy tester. The labels will only form on deals from now onwards (not on trade history).

I coded a solution using the Canvas library, and also the standard library. There are two inputs which can give you the option between using Canvas vs. using text and rectangle objects from the standard library. Feel free to improve upon the code if you think there's yet again a better solution.

Using canvas:

Profit labels in strategy tester

Using standard objects:


Price increase Indicator Price increase Indicator

Price increase Indicator

MarketPredictor MarketPredictor

MarketPredictor for MetaTrader 5 The MarketPredictor is an innovative Expert Advisor (EA) for MetaTrader 5 that leverages mathematical models such as sine functions, Fast Fourier Transform (FFT), sigmoid functions, and Monte Carlo simulations to analyze and predict market movements. This project is designed for developers, math enthusiasts, and traders interested in combining technological and financial innovations. Feel free to suggest, discuss, and implement code ideas directly in this thread. Whether it’s new features, improvement suggestions, or strategies – every contribution is welcome to further develop and optimize the MarketPredictor. You’re also welcome to add me to clarify questions privately, collaborate on the GitHub project, or send me your feedback directly. Let’s cook up something amazing together and take this project to the next level!

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.

Perfect Trailing StopLoss Perfect Trailing StopLoss

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;