Code Block for “Trailing Stop” based on current market price. (Ask / Bid) – EA MetaTrader 5

Code Block for "Trailing Stop" based on current market price. (Ask / Bid) - expert for MetaTrader 5
This code block works if you use either a Stop Loss or Not.  Requirements  You need to include “Trade.mqh ” to get access to the CTrade class which allows you to work with positions and orders. #include <Trade\Trade.mqh> // <<—————————————— Include this “Trade.mqh” to access the CTrade Class You need to set an input parameter … Read more

Take Profit based on current profit – library MetaTrader 4

Minimum Profit
Introduction Many Expert Advisors (EAs) tend to close orders at the take profit level, considering the pip distance from the purchase price. However, the code used by EA NextBot is based mainly on the current profit . This approach allows you to easily manage the take profit with multiple open positions, monitoring the total current profit based … Read more

Check Current Open Orders With Profit – script MetaTrader 4

Screenshot of the script "Check Current Orders With Profit v1.00".
This script lists current open orders with profit. The result is displayed in a message box. If there is at least one open order with profit, a report file is created in .txt format, in Files directory (<terminal_data_folder>/MQL4/Files/). The precise file name format is: report_open_orders_with_profit__[Account Name]__[Server Time].txt Check Current Open Orders With Profit – script … Read more

Class CalcFrac – Number of bars before and after the current High / Low (calculated fractal) – library MetaTrader 5

Class CalcFrac - Number of bars before and after the current High / Low (calculated fractal) - library for MetaTrader 5
Calculates fractals and lets you specify the number of bars separately before and after the current High / Low (fractal).Functions: //+——————————————————————+ //| calculate lower fractals                                         | //+——————————————————————+ bool CalcFrac :: is_lower_fr(int number_of_bars) //+——————————————————————+ //| calculate upper fractals                                         | //+——————————————————————+ bool CalcFrac :: is_upper_fr(int number_of_bars) Sample: Indicator : FractalsPeriod Class CalcFrac – Number of bars before and after … Read more

LOCLinePipsAgile a Script to display distance in pips from horizontal lines to current market price – script MetaTrader 4

LOCLinePipsAgile a Script to display distance in pips from horizontal lines to current market price - script for MetaTrader 4
Description: The script runs in background and writes the distance of pips from horizontal lines on the chart to the current market price. You can drag lines to see the distance. Image: LOCLinePipsAgile a Script to display distance in pips from horizontal lines to current market price – script MetaTrader 4

Murrey Math Lines for the Current Bar – indicator MetaTrader 5

Murrey Math Lines
Real author: Vladislav Goshkov (VG) The well-known theorist Thomas Henning Murrey is widely known in the world of the modern trading. It was he who adapted the theory of the legendary William Gann making it more understandable. Murrey created his famous math lines on the basis of the Gann’s “Square of Nine” principles. The lines … Read more

Straddle Orders Around Current Price Level – script MetaTrader 5

Straddle Orders Around Current Price Level
A script for creating straddle Buy/Sell stop orders. The idea would be that they expire after a certain time period and would straddle the current price action a certain number of points. If there is an existing open position, the position’s stop loss would be set to 1 point less than the opposite order. If … Read more

1 Click To Close All Open Positions at Current Attached Chart – EA MetaTrader 4

1 Click To Close All Open Positions at Current Attached Chart - expert for MetaTrader 4
Click “Close All” button to close all your open positions at current attached chart. Select CloseOnlyManualTrades = true to close only manual trades. Select CloseOnlyManualTrades = false to close manual trades and/or other trades opened by an Expert Advisor. This new version doesn’t contain the code written below that previous versions had which may cause … Read more

Graphically display current trend for all time frames in one simple panel – indicator MetaTrader 4

SlopeDirection
This is a graphical indicator based on slope-direction-trend indicator that has been published under several other forms. There has been several versions of this indicator published already but none that displayed all time frames in a single graphical panel on your screen. One can search to see multiple results. I have taken this indicator and … Read more