버전 13.48
2024.08.27
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.47
2024.08.24
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.45
2024.08.20
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.43
2024.08.19
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.42
2024.08.18
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.41
2024.08.17
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.40
2024.08.16
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.39
2024.08.15
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.38
2024.08.15
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.37
2024.08.14
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.36
2024.08.13
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.35
2024.08.13
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.33
2024.08.13
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.32
2024.08.12
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.31
2024.08.10
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.30
2024.08.09
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.29
2024.08.09
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.28
2024.08.09
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.27
2024.08.06
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.26
2024.08.05
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.25
2024.08.04
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.24
2024.07.31
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.23
2024.07.25
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.22
2024.06.27
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.20
2024.06.24
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.15
2024.06.22
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.13
2024.06.22
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.10
2024.06.14
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.9
2024.06.14
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.8
2024.06.14
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.6
2024.06.13
void fun_29(int para_0_in)
{
int local_1_in;
//-------------
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
//-------------
double shortMA = iMA(global_50_st, 0, 50, 0, MODE_SMA, PRICE_CLOSE, 0);
double longMA = iMA(global_50_st, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
double rsi = iRSI(global_50_st, 60, 20, PRICE_CLOSE, 0);
//-------------
bool isBullish = (shortMA > longMA) && (rsi > 50);
bool isBearish = (shortMA < longMA) && (rsi < 50);
bool isOverbought = (rsi > 70);
bool isOversold = (rsi < 30);
//-------------
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = true;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = false;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0) ||
(isBearish && global_56_do > 0) || (isBullish && global_56_do < 0) ||
(isBearish && global_58_do > 0) || (isBullish && global_58_do < 0) ||
(isBearish && global_21_do > 0 && isOverbought) || (isBullish && global_21_do < 0 && isOversold) ||
(isBearish && global_56_do > 0 && isOverbought) || (isBullish && global_56_do < 0 && isOversold) ||
(isBearish && global_58_do > 0 && isOverbought) || (isBullish && global_58_do < 0 && isOversold)) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
}
}
}
버전 13.5
2024.06.12
void fun_29(int para_0_in) {
int local_1_in;
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxDrawdownLimit = accountEquity * maxDrawdownLimitPercent;
double currentDrawdown = accountBalance - accountEquity;
double shortMA;
double longMA;
double rsi;
int shortMAPeriod = 50;
int longMAPeriod = 200;
int rsiPeriod = 14;
bool isBullish;
bool isBearish;
bool isOverbought;
bool isOversold;
shortMA = iMA(global_50_st, 0, shortMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
longMA = iMA(global_50_st, 0, longMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
rsi = iRSI(global_50_st, 0, rsiPeriod, PRICE_CLOSE, 0);
isBullish = (shortMA > longMA) && (rsi > 50);
isBearish = (shortMA < longMA) && (rsi < 50);
isOverbought = (rsi > 70);
isOversold = (rsi < 30);
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + drawdownDurationHours * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + maxDrawdownCheckDays * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in, 2, 48);
if (StringLen(global_50_st) != 6) {
tmp_st_1 = "99";
} else {
tmp_st_1 = fun_20(StringSubstr(global_50_st, 0, 3)) + fun_20(StringSubstr(global_50_st, 3, 3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st);
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in));
global_42_do = LotsMartinp;
global_18_in = global_19_in;
if ((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != "")) {
local_1_in = para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2;
global_21_do = global_2_a_160_ko[local_1_in].do_3;
global_28_do = global_2_a_160_ko[local_1_in].do_4;
global_29_do = global_2_a_160_ko[local_1_in].do_5;
global_30_in = global_2_a_160_ko[local_1_in].do_6;
global_31_do = global_2_a_160_ko[local_1_in].do_7;
global_33_do = global_2_a_160_ko[local_1_in].do_8;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in));
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in));
global_129_do = MarketInfo(global_50_st, 13);
global_125_do = MarketInfo(global_50_st, 13) * MarketInfo(global_50_st, 11);
global_126_do = MarketInfo(global_50_st, 10);
global_127_do = MarketInfo(global_50_st, 9);
global_128_do = MarketInfo(global_50_st, 11);
global_130_do = 0.0;
if (iClose(global_50_st, 0, 1) > 0.0) {
global_130_do = (MathAbs(global_127_do / iClose(global_50_st, 0, 1) - 1.0)) * 10000.0;
}
fun_13();
if (iATR(global_50_st, 1440, global_22_in, 1) / MarketInfo(global_50_st, 9) > global_23_do) {
global_123_bo = false;
return;
}
global_123_bo = true;
if ((isBearish && global_21_do > 0) || (isBullish && global_21_do < 0)) {
global_123_bo = false;
return;
}
}
}
버전 13.2
2024.06.11
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 12.5
2024.06.11
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 12.3
2024.06.07
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 11.5
2024.06.07
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 11.0
2024.06.07
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 9.9
2024.06.07
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 9.0
2024.06.07
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
Version 7.5 2024.06.03
버전 7.9
2024.06.06
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 7.5
2024.06.03
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 7.1
2024.06.02
void fun_29(int para_0_in)
{
int local_1_in;
//----- -----
string tmp_st_1;
string tmp_st_2;
string tmp_st_3;
static datetime maxDrawdownStartTime = 0;
static datetime maxDrawdownEndTime = 0;
static bool drawdownPaused = False;
static datetime maxDrawdownCheckTime = 0;
static double movingAverageDrawdown = 0.0;
static int drawdownPeriod = 14;
static double emergencyStopLimit = 0.2;
double accountBalance = AccountBalance();
double accountEquity = AccountEquity();
double maxFixedDrawdownLimit = accountEquity * 0.09;
double maxDynamicDrawdownLimit = movingAverageDrawdown * 1.2;
double maxDrawdownLimit = MathMin(maxFixedDrawdownLimit, maxDynamicDrawdownLimit);
double currentDrawdown = accountBalance - accountEquity;
//----- -----
if (maxDrawdownCheckTime == 0) {
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
static double drawdownHistory[14] = {0};
static int drawdownIndex = 0;
drawdownHistory[drawdownIndex] = currentDrawdown;
drawdownIndex = (drawdownIndex + 1) % drawdownPeriod;
double drawdownSum = 0.0;
for (int i = 0; i < drawdownPeriod; i++) {
drawdownSum += drawdownHistory[i];
}
movingAverageDrawdown = drawdownSum / drawdownPeriod;
if (currentDrawdown / accountEquity >= emergencyStopLimit) {
drawdownPaused = True;
Print("Emergency stop triggered! Drawdown exceeded ", emergencyStopLimit * 100, "%.");
return;
}
if (currentDrawdown >= maxDrawdownLimit && !drawdownPaused && TimeCurrent() >= maxDrawdownCheckTime) {
maxDrawdownStartTime = TimeCurrent();
maxDrawdownEndTime = TimeCurrent() + 24 * 60 * 60;
drawdownPaused = True;
maxDrawdownCheckTime = TimeCurrent() + 7 * 24 * 60 * 60;
}
if (TimeCurrent() >= maxDrawdownEndTime && drawdownPaused) {
drawdownPaused = False;
maxDrawdownStartTime = 0;
maxDrawdownEndTime = 0;
}
if (!drawdownPaused) {
global_93_st = IntegerToString(para_0_in,2,48) ;
if(StringLen(global_50_st) != 6)
{
tmp_st_1 = "99";
}
else
{
tmp_st_1 = fun_20(StringSubstr(global_50_st,0,3)) + fun_20(StringSubstr(global_50_st,3,3));
}
global_26_in = StringToInteger(tmp_st_1 + global_93_st) ;
global_25_in = GlobalVariableGet(string(IsTesting()) + "Magic" + global_50_st + string(global_26_in)) ;
global_42_do = LotsMartinp ;
global_18_in = global_19_in ;
if((global_3_in != 1 || StringTrimLeft(StringTrimRight(global_4_st)) != ""))
{
local_1_in=para_0_in - 1;
global_18_in = global_2_a_160_ko[local_1_in].in_2 ;
global_21_do = global_2_a_160_ko[local_1_in].do_3 ;
global_28_do = global_2_a_160_ko[local_1_in].do_4 ;
global_29_do = global_2_a_160_ko[local_1_in].do_5 ;
global_30_in = global_2_a_160_ko[local_1_in].do_6 ;
global_31_do = global_2_a_160_ko[local_1_in].do_7 ;
global_33_do = global_2_a_160_ko[local_1_in].do_8 ;
}
global_14_in = GlobalVariableGet(string(IsTesting()) + "NUMBER" + global_50_st + string(global_26_in)) ;
global_69_do = GlobalVariableGet(string(IsTesting()) + "Distance_Price" + global_50_st + string(global_26_in)) ;
global_129_do = MarketInfo(global_50_st,13) ;
global_125_do = MarketInfo(global_50_st,13) * MarketInfo(global_50_st,11) ;
global_126_do = MarketInfo(global_50_st,10) ;
global_127_do = MarketInfo(global_50_st,9) ;
global_128_do = MarketInfo(global_50_st,11) ;
global_130_do = 0.0 ;
if(iClose(global_50_st,0,1)>0.0)
{
global_130_do = (MathAbs(global_127_do / iClose(global_50_st,0,1) - 1.0)) * 10000.0 ;
}
fun_13();
if(iATR(global_50_st,86400,global_22_in,1) / MarketInfo(global_50_st,9)>global_23_do)
{
global_123_bo = false ;
return;
}
global_123_bo = true ;
}
}
버전 7.0
2024.06.01
In the new update of the Orion Intelligence System,
I implemented new privacy measures against scammers and those who attempt to crack my EA.
If they try to crack it and use it on their live account,
it will generate errors. We worked on this EA for over three years, dedicating a lot of time to its development,
so that traders who are struggling with their trades can benefit from it.
버전 5.9
2024.05.31
MultiCurrency Mode separated by comma (Limit to 9)
버전 5.5
2024.05.28
MultiCurrency Mode separated by comma (Limit to 9)
버전 5.0
2024.05.28
MultiCurrency Mode separated by comma (Limit to 9)
버전 3.9
2024.05.27
In the new update of the Orion Intelligence System,
I implemented new privacy measures against scammers and those who attempt to crack my EA.
If they try to crack it and use it on their live account,
it will generate errors. We worked on this EA for over three years, dedicating a lot of time to its development,
so that traders who are struggling with their trades can benefit from it.
버전 3.5
2024.05.26
The latest update (v3.5) of our EA brings critical changes to the setting of stoploss for both OP_SELL and OP_BUY orders. In this update, we have optimized the setting of stoploss by adjusting their values to provide better protection against unexpected market movements. This update enhances safety and security for our clients while they engage in forex trading.
버전 3.0
2024.05.25
The latest update (v3.0) of our EA brings critical changes to the setting of stoploss for both OP_SELL and OP_BUY orders. In this update, we have optimized the setting of stoploss by adjusting their values to provide better protection against unexpected market movements. This update enhances safety and security for our clients while they engage in forex trading.
버전 1.7
2024.05.17
The latest update (v1.7) of our EA brings critical changes to the setting of stoploss for both OP_SELL and OP_BUY orders. In this update, we have optimized the setting of stoploss by adjusting their values to provide better protection against unexpected market movements. This update enhances safety and security for our clients while they engage in forex trading.
버전 1.5
2024.05.17
The latest update (v1.5) of our EA brings critical changes to the setting of stoploss for both OP_SELL and OP_BUY orders. In this update, we have optimized the setting of stoploss by adjusting their values to provide better protection against unexpected market movements. This update enhances safety and security for our clients while they engage in forex trading.