young Call girls in Dwarka sector 1🔝 9953056974 🔝 Delhi escort Service
Mdp plus 2.1
1. // -------------------------------------------------------------------------------------------------
// MDP-Plus v. 2.1.2
//
// Based on MillionDollarPips - (ANY PAIR + NO DLL) - ver 1.1.0
//
// Someone at a russian forum fixed a Stack Overflow problem, added NDD-mode (ECN-mode)
// and moved the DLL-functions in the mql4-code.
//
// Sept-2011 by Capella by at http://www.worldwide-invest.org
// - Cleaned code from unused code, proper variable names and sub-names.
//
// Ver. 1.0 - 2011-09-24 by Capella at http://www.worldwide-invest.org
// - Added Print lines for STOPLEVEL when errors (for debugging purposes)
// - Removed unused externals and variables
// - Moved dynamic TP/SL and trading signals constants to externals,
// as VolatilityLimit and Scalpfactor.
// - Forced TrailingStop
//
// Ver. 2.0 - 2011-10-19 by Capella at http://www.worldwide-invest.org
// - Fixing bugs, and removed unused code.
// - Forced Trailing, as no-trailing cannot generate profit
// - Forced HighSpeed, as false mode cannot give good result
// - Added additional settings for scalping - UseMovingAverage,
// UseBollingerBands, and OrderExpireSeconds
// - Automatic adjusted to broker STOPLEVEL, to avoid OrderSend error 130
// Ver 2.1 - 2011-11-91 by Capella at http://www.worldwide-invest.org
// - Added Indicatorperiod as external
// - Modified calculation of variable that triggers trade (local_pricedirection)
// - Removed Distance as an external, and automatically adjust Distance to be the same as stoplevel
// - Removed call for sub_moveandfillarrays as it doesn't make any difference
// Ver 2.1.1 - 2011-11-05 by Capella at http://www.worldwide-invest.org
// - Fixed a bug in the calculation of local_highest and local_lowest that caused wrong call for
// OrderModify.
// - Changed the calculation of STOPLEVEL to also consider FREEZELEVEL
// Ver 2.1.2 - 2011-11-06 by Capella
// - Changed default settings according to optimized backtests
// - Added external parameter Deviation for iBands, default 0
// -------------------------------------------------------------------------------------------------
#property show_inputs
#include <stdlib.mqh>
//----------------------- Externals ----------------------------------------------------------------
// All externals here have their name starting with a CAPITAL character
extern string Configuration = "==== Configuration ====";
extern int Magic = 0;
extern string OrderCmt = "";
extern bool NDDmode = FALSE;
extern bool Show_Debug = FALSE;
extern bool Verbose = FALSE;
extern string ScalpingSettings = "==== Scalping settings ====";
extern double TakeProfit = 10.0; // TakeProfit from as many points. Default 10 (= 1 pip)
extern double StopLoss = 60.0; // StopLoss from as many points. Default 60 (= 6 pips)
extern double Trailing_Start = 0; // Start trailing profit from as so many pips. Default 0
extern double VolatilityLimit = 180; // Default 180. Can normally be between 100 and 300
extern double Scalpfactor = 66; // 60 to 77 - only used if larger than broker StopLevel
extern bool UseMovingAverage = TRUE; // User two iMA as channell
extern bool UseBollingerBands = TRUE; // Use iBands as channel
extern int IndicatorPeriod = 30; // Period for iMA and iBands
extern double Deviation = 2.00; // Deviation for iBands
extern int OrderExpireSeconds = 3600; // Orders are deted after so many seconds
extern string Money_Management = "==== Money Management ====";
extern double Min_Lots = 0.01;
extern double Max_Lots = 100.0;
extern double Risk = 100.0;
//--------------------------- Globals --------------------------------------------------------------
// All globals have their name written in lower case characters
//
bool condition1;
bool condition2 = FALSE;
bool trailingstop = TRUE;
int distance = 0;
int brokerdigits = 0;
int slippage = 3;
int array_tickcounts[30];
int globalerror = 0;
int lasttime = 0;
int tickcounter = 0;
int upto30counter = 0;
int AccNum;
double zero = 0.0;
double zeropointfour = 0.4;
double one = 1.0;
double five = 5.0;
double ten = 10.0;
double twenty = 20.0;
Page 1/8
2. double forty = 40.0;
double multiplier;
double commission = 0.0;
double minmaxlot = 0.1;
double maxamount = 0.0;
double pipette = 0.0;
double upper;
double lower;
double array_bid[30];
double array_ask[30];
double array_spread[30];
//======================= Program initialization ===========================================================
int init()
{
int stoplevel;
ArrayInitialize(array_spread, 0);
VolatilityLimit = VolatilityLimit * Point;
Scalpfactor = Scalpfactor * 10 * Point / 3;
brokerdigits = Digits;
pipette = Point;
stoplevel = MathMax(MarketInfo(Symbol(), MODE_FREEZELEVEL), MarketInfo(Symbol(), MODE_STOPLEVEL));
if (TakeProfit < stoplevel)
TakeProfit = stoplevel;
if (StopLoss < stoplevel)
StopLoss = stoplevel;
if (distance < stoplevel)
distance = stoplevel;
if (MathMod(Digits, 2) == 0)
slippage = 0;
else
globalerror = -1;
start();
return (0);
}
//====================== Program start ===================================
int start()
{
if (brokerdigits == 0)
{
init();
return;
}
sub_trade();
return (0);
}
//===================== Subroutines starts here =========================================
// All subs have their names starting with sub_
// Exception are the standard routines init() and start()
//
// Notation:
// All parameters in subs have their names starting with par_
// All local variables in subs have thewir names starting with local_
//
void sub_trade()
{
string local_textstring;
bool local_wasordermodified;
bool local_highspeed;
bool local_ordersenderror;
bool local_isbidgreaterthanima;
bool local_isbidgreaterthanibands;
bool local_isbidgreaterthanindy;
int local_orderticket;
int local_lotstep;
int local_orderexpiretime;
int local_bidpart;
int local_askpart;
int local_loopcount2;
int local_loopcount1;
int local_pricedirection;
int local_counter1;
int local_counter2;
double local_askplusdistance;
double local_bidminusdistance;
double local_a;
double local_b;
double local_c;
double local_scalpsize;
Page 2/8