Исходный код · ID 1580
mq4_ilan_16td_cci_1.21.mq5
Вы автор или правообладатель?
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «mq4_ilan_16td_cci_1.21.mq5» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
Поиск по коду файла
#include <mt4accountinfo.mqh>
#include <mt4string.mqh>
#include <mt4datetime.mqh>
#include <mt4objects_3.mqh>
#include <mt4timeseries_4.mqh>
double Ask,Bid,Point;
int Bars;
input string t1 = "????? Turbo";
input bool Turbo = true; // ????? ?????
input string t2 = "????? Dynamic";
input bool Dynamic = true; // ????? Dynamic
input string t3 = "? ?????? ??? ?????? ?????? Dynamic (?? < 4)";
input int StartDynamic = 4; // ?????, ? ???????? ???????? ???????? ????? Dynamic
input string t4 = "NewCycle ????? ?????? ??????????? ????? ???????";
input bool NewCycle = true; // ????? ?????? ??????????? ????? ???????
input string t5 = "?????? MA";
input int PerMA = 20;
input string t6 = "??????? CCI ??? ??????";
input double Drop1 = 100; // ??????? CCI ??? ??????
input double Drop2 = 105; // ??????? CCI ??? ??????
string t7 = "?????????? CCI";
int timefr1 = 1; // ?? CCI
int timefr2 = 5; // ?? CCI
input string t8 = "??????? CCI";
input double Per1 = 95; // ?????? CCI
input double Per2 = 70; // ?????? CCI
input int applied_price = 6; //?????? ??????? ???? ?????? ????. ??? ??????? ???. ?? ?????? 6!!!!!!!!!!!
input string t9 = "????? ?????????";
input double LotExponent = 1.95;
input double slip = 5.0;
input double Lots = 0.01;
input int lotdecimal = 2;
input double TakeProfit = 10.0;
input double PipStep_ = 30.0;
double PipStep,PipS ;
input int MaxTrades = 10;
bool UseEquityStop = false;
double TotalEquityRisk = 20.0;
bool UseTrailingStop = false;
double TrailStart = 10.0;
double TrailStop = 10.0;
double Stoploss = 500.0;
bool UseTimeOut = false;
double MaxTradeOpenHours = 48.0;
input int g_magic_176 = 12324;
input string t_ = "??????? ????????!";
double g_price_180, Balans, Sredstva ;
double gd_188;
double gd_unused_196;
double gd_unused_204;
double g_price_212;
double g_bid_220;
double g_ask_228;
double gd_236;
double gd_244;
double gd_260;
bool gi_268;
string gs_ilan_272 = "Ilan_16TD_CCI_1.2";
int g_time_280 = 0;
int gi_284,ord_16,ord_N ;
int gi_288 = 0;
double gd_292;
int g_pos_300 = 0;
int gi_304;
double gd_308 = 0.0;
bool gi_316 = false;
bool gi_320 = false;
bool gi_324 = false;
int gi_328;
bool gi_332 = false;
double gd_336;
double gd_344;
string txt,txt1;
string txt2="";
string txt3="";
color col = ForestGreen;
int OnInit() {
// код доступен только после оплаты
}
void OnDeinit(const int reason) {
Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);
Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);
Bars=Bars(Symbol(),PERIOD_CURRENT);
ObjectDelete("Lable");
ObjectDelete("Lable1");
ObjectDelete("Lable2");
ObjectDelete("Lable3");
/* return (0);*/
}
void OnTick() {
// код доступен только после оплаты
}
Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);
Bid=SymbolInfoDouble(Symbol(),SYMBOL_BID);
Bars=Bars(Symbol(),PERIOD_CURRENT);
double l_iclose_8;
double l_iclose_16;
if (UseTrailingStop) TrailingAlls(TrailStart, TrailStop, g_price_212);
if (UseTimeOut) {
if (TimeCurrent() >= gi_284) {
CloseThisSymbolAll();
Print("Closed All due to TimeOut");
}
}
{
Comment(""
+ "\n"
+ "Ilan_16TD_CCI_1.2"
+ "\n"
+ "________________________________"
+ "\n"
+ "??????: " + AccountCompany()
+ "\n"
+ "????? ???????: " + TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS)
+ "\n"
+ "________________________________"
+ "\n"
+ "????: " + AccountName()
+ "\n"
+ "????? ???? " + AccountNumber()
+ "\n"
+ "_______________________________"
+ "\n"
+ "??????? ??????? Ilan_16TD_CCI :" + CountTrades()
+ "\n"
+ "_______________________________"
+ "\n"
+ "??????: " + DoubleToStr(AccountBalance(), 2)
+ "\n"
+ "????????? ????????: " + DoubleToStr(AccountEquity(), 2)
+ "\n"
+ "_______________________________");
}
ord_16 = CountTrades();
if (Turbo)
{
if (ord_16 == 1) PipStep = PipStep_/3;
if (ord_16 == 2) PipStep = PipStep_/3*2;
if (ord_16 >= 3) PipStep = PipStep_;
}
else PipStep = PipStep_;
{ //=================Dynamic-?????
ord_N = CountTrades();
{if (ord_N >= StartDynamic)
if (Dynamic)
{ double hival=High[iHighest(NULL,0,MODE_HIGH,36,1)]; // ?????????? ?????????? ???? ?? ????????? 36 ????
double loval=Low[iLowest(NULL,0,MODE_LOW,36,1)]; // ?????????? ?????????? ???? ?? ????????? 36 ????//chart used for symbol and time period
PipS=NormalizeDouble((hival-loval)/3/Point,0); // ?????? PipStep
if (PipS>PipStep_*2) PipStep = PipStep_*2; // if dynamic pips fail, assign pips extreme value
} else PipStep = PipStep_;
}
}
{ //ForestGreen' YellowGreen' Yellow' OrangeRed' Red
Balans = NormalizeDouble( AccountBalance(),2);
Sredstva = NormalizeDouble(AccountEquity(),2);
if (Sredstva >= Balans/6*5) col = DodgerBlue;
if (Sredstva >= Balans/6*4 && Sredstva < Balans/6*5)col = DeepSkyBlue;
if (Sredstva >= Balans/6*3 && Sredstva < Balans/6*4)col = Gold;
if (Sredstva >= Balans/6*2 && Sredstva < Balans/6*3)col = OrangeRed;
if (Sredstva >= Balans/6 && Sredstva < Balans/6*2)col = Crimson;
if (Sredstva < Balans/5 )col = Red;
ObjectDelete("Lable2");
ObjectCreate("Lable2",OBJ_LABEL,0,0,1.0);
ObjectSet("Lable2", OBJPROP_CORNER, 3);
ObjectSet("Lable2", OBJPROP_XDISTANCE, 33);
ObjectSet("Lable2", OBJPROP_YDISTANCE, 31);
txt2=(DoubleToStr(AccountBalance(), 2));
ObjectSetText("Lable2","?????? "+txt2+"",16,"Times New Roman",DodgerBlue);
ObjectDelete("Lable3");
ObjectCreate("Lable3",OBJ_LABEL,0,0,1.0);
ObjectSet("Lable3", OBJPROP_CORNER, 3);
ObjectSet("Lable3", OBJPROP_XDISTANCE, 33);
ObjectSet("Lable3", OBJPROP_YDISTANCE, 11);
txt3=(DoubleToStr(AccountEquity(), 2));
ObjectSetText("Lable3","???????? "+txt3+"",16,"Times New Roman",col);
}
if (g_time_280 == Time[0]) return (0);
g_time_280 = Time[0];
double ld_0 = CalculateProfit();
if (UseEquityStop) {
if (ld_0 < 0.0 && MathAbs(ld_0) > TotalEquityRisk / 100.0 * AccountEquityHigh()) {
CloseThisSymbolAll();
Print("Closed All due to Stop Out");
gi_332 = false;
}
}
gi_304 = CountTrades();
if (gi_304 == 0) gi_268 = false;
for (g_pos_300 = OrdersTotal() - 1; g_pos_300 >= 0; g_pos_300--) {
OrderSelect(g_pos_300, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_176) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_176) {
if (OrderType() == OP_BUY) {
gi_320 = true;
gi_324 = false;
break;
}
}
if (OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_176) {
if (OrderType() == OP_SELL) {
gi_320 = FALSE;
gi_324 = TRUE;
break;
}
}
}
if (gi_304 > 0 && gi_304 <= MaxTrades) {
RefreshRates();
gd_236 = FindLastBuyPrice();
gd_244 = FindLastSellPrice();
if (gi_320 && gd_236 - Ask >= PipStep * Point) gi_316 = TRUE;
if (gi_324 && Bid - gd_244 >= PipStep * Point) gi_316 = TRUE;
}
if (gi_304 < 1) {
gi_324 = FALSE;
gi_320 = FALSE;
gi_316 = TRUE;
gd_188 = AccountEquity();
}
if (gi_316) {
gd_236 = FindLastBuyPrice();
gd_244 = FindLastSellPrice();
if (gi_324) {
gi_288 = gi_304;
gd_292 = NormalizeDouble(Lots * MathPow(LotExponent, gi_288), lotdecimal);
RefreshRates();
gi_328 = OpenPendingOrder(1, gd_292, NormalizeDouble(Bid,Digits), slip, NormalizeDouble(Ask,Digits), 0, 0, gs_ilan_272 + "-" + gi_288, g_magic_176, 0, HotPink);
if (gi_328 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_244 = FindLastSellPrice();
gi_316 = FALSE;
gi_332 = TRUE;
} else {
if (gi_320) {
gi_288 = gi_304;
gd_292 = NormalizeDouble(Lots * MathPow(LotExponent, gi_288), lotdecimal);
gi_328 = OpenPendingOrder(0, gd_292, NormalizeDouble(Ask,Digits), slip, NormalizeDouble(Bid,Digits), 0, 0, gs_ilan_272 + "-" + gi_288, g_magic_176, 0, Lime);
if (gi_328 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_236 = FindLastBuyPrice();
gi_316 = FALSE;
gi_332 = TRUE;
}
}
}
if (NewCycle) {
if (gi_316 && gi_304 < 1) {
l_iclose_8 = iMA(NULL,0,PerMA,0,MODE_LWMA,PRICE_WEIGHTED,3);//????????? ???????????..
l_iclose_16 = iMA(NULL,0,PerMA,0,MODE_LWMA,PRICE_WEIGHTED,1);//..??????????? ??????
g_bid_220 = NormalizeDouble(Bid,Digits);
g_ask_228 = NormalizeDouble(Ask,Digits);
if (!gi_324 && !gi_320) {
gi_288 = gi_304;
gd_292 = NormalizeDouble(Lots * MathPow(LotExponent, gi_288), lotdecimal);
if (l_iclose_8 != l_iclose_16) // ?? ??????, ???? ??? ???????? ????
{
if (l_iclose_8 > l_iclose_16)// ???? ???? ????????, ?????????? ???????????...
{
if ((iCCI(NULL,timefr1,Per1,appliedПоказано первые 50% кода (символов: 14617)
Что вы получите после оплаты
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? Адрес передаётся вместе с заказом в магазин и сохраняется для связи заказа с оплатой. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.
Стоимость полного кода
1 462₽
≈ $17.18