Trading signals function. Based on the values of the CCI indicator. – library MetaTrader 4

Trading signals function. Based on the values of the CCI indicator. - library for MetaTrader 4
Trading signals function. Based on the values of the CCI indicator. Add the function to the EA: #include <Signal.mqh> Condition if(GetSignal()==1) is for buys. Condition if(GetSignal()==-1) is for sells. External variables of the function: periodCCI – the period of averaging for calculation of the indicator. applied_price – Used price. It can be any of the … Read more

TimeInRange time checking function – library MetaTrader 4

TimeInRange time checking function - library for MetaTrader 4
Fast time range checking function. Doesn’t use slow string parsing. Function returns TRUE if time in range, FALSE otherwise. Usage: Drop .mq4 file to MQL4\Libraries\ folder. Add this line inside your EA: #include “..\libraries\time_in_range.mq4″There are three versions of the function:1. With separated hours and minutes input. Example: if(TimeInRange(TimeCurrent(),23,00,02,15)) { /* trade */ } // checks … Read more

Trade Transmitter via web and OnTrade Function to MQL4 – script MetaTrader 4

Trade Transmitter via web and OnTrade Function to MQL4 - script for MetaTrader 4
This EA has 3 Very Interesting Functions: 1. It can Detect Trades and its modifications in the account, made by other EAs or made manually. 2. Once trades are detected, it can transmit each Trade over the web to any Server or any webapplication API (May require modification by professional coder, depending on the API). … Read more

Function to get Next Open Time and Closing Time for the market. – library MetaTrader 5

Function to get Next Open Time and Closing Time for the market. - library for MetaTrader 5
A Simple Call to this function will return the next Opening Time and Closing Time of the Asset, if no from time input it will search following the current Trade Server Time.  Usage: GetOpeningTimes(Open_Time, Close_Time, time); // where time is the from time GetOpeningTimes(Open_Time, Close_Time); // searches from current time… Enjoy… Function to get Next … Read more

Trailing Function – script MetaTrader 4

Trailing Function - script for MetaTrader 4
//+——————————————————————+ //|                                                                  | //+——————————————————————+ void Trailing(double trailingStartPips, double _trailingPips, double initialStopLossInPips=0, bool useSymbol=false, bool useMagicNumber=false, int _magicNumber=0, bool initialStopLossWillBeDone=true) {     for(int i=OrdersTotal()-1; i>=0; i–) {         if(OrderSelect(i,SELECT_BY_POS)) {             bool magic = (useMagicNumber) ? (OrderMagicNumber()==_magicNumber) : true;             bool symbol = (useSymbol) ? (OrderSymbol()==Symbol()) : true;             if(!magic || !symbol) continue;             if(OrderType() == OP_BUY) {                 if(OrderStopLoss() >= NormalizeDouble(OrderOpenPrice() + initialStopLossInPips*_Point*10,_Digits) … Read more

Trailing Step Function – script MetaTrader 4

Trailing Step Function - script for MetaTrader 4
//+——————————————————————+ //|                                                                  | //+——————————————————————+ void TrailingStep(double trailingStepStartPips, double _trailingStepPips, double initialStopLossInPips=0, bool useSymbol=false, bool useMagicNumber=false, int _magicNumber=0, bool initialStopLossWillBeDone=true) {     for(int i=OrdersTotal()-1; i>=0; i–) {         if(OrderSelect(i,SELECT_BY_POS)) {             bool magic = (useMagicNumber) ? (OrderMagicNumber()==_magicNumber) : true;             bool symbol = (useSymbol) ? (OrderSymbol()==Symbol()) : true;             if(!magic || !symbol) continue;             if(OrderType() == OP_BUY) {                 if(OrderStopLoss() >= NormalizeDouble(OrderOpenPrice() + initialStopLossInPips*_Point*10,_Digits) … Read more

BreakEven Function – script MetaTrader 4

BreakEven Function - script for MetaTrader 4
//+——————————————————————+ //|Breakeven                                                         | //+——————————————————————+ void BreakEven(double _breakEvenPips, bool useSymbol=false, bool useMagicNumber=false, int _magicNumber=0) {     for(int i=OrdersTotal()-1; i>=0; i–) {         if(OrderSelect(i,SELECT_BY_POS)) {             bool magic = (useMagicNumber) ? (OrderMagicNumber()==_magicNumber) : true;             bool symbol = (useSymbol) ? (OrderSymbol()==Symbol()) : true;             if(!magic || !symbol) continue;             if(OrderType() == OP_BUY) {                 if(NormalizeDouble(OrderStopLoss(),_Digits) < NormalizeDouble(OrderOpenPrice(),_Digits)) {                     if(Bid – OrderOpenPrice() >= NormalizeDouble(_breakEvenPips * … Read more

Daily Profit Function – EA MetaTrader 5

Daily Profit Function - expert for MetaTrader 5
I wrote this function as an easy template for accessing the current day’s trading history. Can be expanded upon by the user by adding additional doubles, i.e. Volume, or for different periods, by amending the start variable.  The Daily Profit value is written to the Experts Panel by default. Very simple, easily understood code. Daily … Read more