Code blocks for “Counters” like Count “X” time and pass – EA MetaTrader 5

Code blocks for "Counters" like Count "X" time and pass - expert for MetaTrader 5
01. Count “X” Times and then pass. Step 01 – Created a variable for set the count limit. you can use it as an input parameter as well of optimization in your code.  Step 02 – Create another variable to store the counted limit (How many times it has been counted). Step 03 – Once

A Code block to detect A “New Candle/Bar” using bars history (very effective way) – EA MetaTrader 5

A Code block to detect A "New Candle/Bar" using bars history (very effective way) - expert for MetaTrader 5
In previous code I used the time to detect a new bar. This time let’s use the bars count to detect a new bar. it’s way lighter and faster than using the time method. Declare the variables in integer data type to store the bar counts.  Assign the bars count for the “BarsTotal_OnInt” at the

Simple Code for Detect A “New Bar or New Candle ” Received – EA MetaTrader 5

Simple Code for Detect  A  "New Bar or New Candle " Received - expert for MetaTrader 5
This code block detects a New Bar or a New Candle when it has received.  the basic principle of the codes is very simple. First the code stores the Time of the previous bar / Candle. (Then add 60 seconds (equals to 1 min. you can add time as you want) to the Time of

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

Error_Break_Script_V1 – This script is a general example of using error brake in any strategy – Break on Code Error Sample Strategy – script MetaTrader 4

Error_Break_Script_V1  - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy - script for MetaTrader 4
This script is a general example of using error brake codes in any strategy. Error_Break_Script_V1 – This script is a general example of using error brake in any strategy – Break on Code Error Sample Strategy – script MetaTrader 4