Исходный код · ID 443
o2.mq4
Похожие материалы по тегам
doubletap3d.mq5MetaTrader 5 · 1 общих теговday type radar for tradingview.txtTradingView · 1 общих теговea robofibo source v.11.2.mq4MetaTrader 4 · 1 общих теговzuluquantsupertrend_pro_elite_v6.mq5MetaTrader 5 · 1 общих теговtraders_dynamic_cb_ssa_norm_index_alerts+arrows1@lifeindreamsworld.mq4MetaTrader 4 · 1 общих теговtrader-criptom4n fixed eror.txtTradingView · 1 общих тегов
Вы автор или правообладатель?
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «o2.mq4» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
Поиск по коду файла
#define pi 3.141592653589793238462643383279502884197169399375105820974944592
extern int Trend = 0;
extern int TrendTimeFrame = PERIOD_M5;
extern int TrendPeriod = 36;
extern int HLPeriod = 240;
extern double TPAsPercentageOfATR = 33;
extern double TPvsTrendAsPercentageOfTP = 50;
extern double Risk = 10.0;
extern int PipsNoRollback = 0;
extern int Magic = 20080531;
extern int Magic2 = -1;
extern int Attempt = 4;
extern int SleepForWait=333;
extern int NeedLog = 0;
int CCIPeriod = 30;
int CCIOversold = -100;
int CCIOverbought = 100;
bool NeedUpdateTP = true;
bool IsIndCalc = False;
int PrevOBuy = 0, PrevOSell = 0, PrevTarget = 0;
double TRVI(string symbol, int timeframe, int RVIPeriod = 36, int shift = 0) {
string sy = symbol;
int tf = timeframe;
if(symbol == "") sy = Symbol();
if(timeframe == 0) tf = Period();
double sOpen[], sClose[], sHigh[], sLow[], sVolume[];
ArrayCopySeries(sOpen,MODE_OPEN,sy,tf);
if(GetLastError()==4066) {Print("HISTORY WILL UPDATED: ", sy); IsIndCalc = False; return(0.0);}
ArrayCopySeries(sClose,MODE_CLOSE,sy,tf);
if(GetLastError()==4066) {Print("HISTORY WILL UPDATED: ", sy); IsIndCalc = False; return(0.0);}
ArrayCopySeries(sHigh,MODE_HIGH,sy,tf);
if(GetLastError()==4066) {Print("HISTORY WILL UPDATED: ", sy); IsIndCalc = False; return(0.0);}
ArrayCopySeries(sLow,MODE_LOW,sy,tf);
if(GetLastError()==4066) {Print("HISTORY WILL UPDATED: ", sy); IsIndCalc = False; return(0.0);}
ArrayCopySeries(sVolume,MODE_VOLUME,sy,tf);
if(GetLastError()==4066) {Print("HISTORY WILL UPDATED: ", sy); IsIndCalc = False; return(0.0);}
double dNum = 0.0, dDeNum = 0.0;
for(int k = 0; k < RVIPeriod; k++) {
int j = shift + k;
double Norm = RVIPeriod - k + 1;
dNum += Norm * ((sVolume[j]*(sClose[j] - sOpen[j])+8.0*sVolume[j+1]*(sClose[j+1]-sOpen[j+1])+8.0*sVolume[j+2]*(sClose[j+2]-sOpen[j+2])+sVolume[j+3]*(sClose[j+3]-sOpen[j+3])));
dDeNum += Norm * ((sVolume[j]*(sHigh[j]-sLow[j])+8.0*sVolume[j+1]*(sHigh[j+1]-sLow[j+1])+8.0*sVolume[j+2]*(sHigh[j+2]-sLow[j+2])+sVolume[j+3]*(sHigh[j+3]-sLow[j+3])));
}
IsIndCalc = True;
double res = 0.0;
if(dDeNum != 0.0) res = dNum/dDeNum;
else res = dNum;
return(res);
}
int init() {
// код доступен только после оплаты
}
int start() {
// код доступен только после оплаты
}
int na, i, res, Total = OrdersTotal();
bool OK = true;
string sy = Symbol();
double Profit, AvgBuy, AvgSell, MinBuy, MinSell, MaxBuy, MaxSell, BuyLots, SellLots, ProfitBuy, ProfitSell;
int OBuy, OSell;
for(na = 0;na < Attempt;na++) {
Profit = 0.0;
AvgBuy = 0.0;
AvgSell = 0.0;
MinBuy = 0.0;
MinSell = 0.0;
MaxBuy = 0.0;
MaxSell = 0.0;
BuyLots = 0.0;
SellLots = 0.0;
OBuy = 0;
OSell = 0;
for(i = 0;i < Total; i++) {
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == false) {
OK = False;
break; }
int OMN = OrderMagicNumber();
if(OrderSymbol() != sy) continue;
if(Magic2 != -1 && Magic != OMN && Magic2 != OMN) continue;
int OType = OrderType();
if(OType != OP_BUY && OType != OP_SELL) continue;
double OPrice = OrderOpenPrice(); //OrderCommission
double OLots = OrderLots();
double OTP = OrderTakeProfit();
if(OTP == 0.0) NeedUpdateTP = True;
double OProfit = OTP + OrderSwap() + OrderCommission();
if(OType == OP_BUY) {
OBuy++;
BuyLots += OLots;
AvgBuy += OLots * OPrice;
MaxBuy = MathMax(MaxBuy,MathMax(OPrice,OTP));
if(OPrice < MinBuy || MinBuy == 0.0) MinBuy = OPrice;
ProfitBuy += OProfit; }
if(OType == OP_SELL) {
OSell++;
SellLots += OLots;
AvgSell += OLots * OPrice;
if(OPrice > MaxSell) MaxSell = OPrice;
if(OPrice < MinSell || MinSell == 0.0) MinSell = OPrice;
if(OTP < MinSell && OTP != 0.0) MinSell = OTP;
ProfitSell += OProfit; }
OK = True;
}
if(OK) break;
}
if(!OK) {
Print("?? ??????? ???????? ??????????? ??????????!");
return(0); }
if(PrevOBuy != OBuy) NeedUpdateTP = true;
if(PrevOSell != OSell) NeedUpdateTP = true;
PrevOBuy = OBuy;
PrevOSell = OSell;
double RVI = 0.0;
double sPoint = MarketInfo(sy,MODE_POINT);
int sDigits = MarketInfo(sy,MODE_DIGITS);
double sAsk = NormalizeDouble(MarketInfo(sy,MODE_ASK), sDigits);
double sBid = NormalizeDouble(MarketInfo(sy,MODE_BID), sDigits);
double sSpread = sAsk - sBid;
double ATR = MathMax(24.0 * sSpread, MathMax(iATR(sy,PERIOD_D1,20,0),iATR(sy,PERIOD_D1,20,1)));
double TPTrend = NormalizeDouble(ATR * TPAsPercentageOfATR * 0.01, sDigits);
double TPvsTrend = NormalizeDouble(TPTrend * TPAsPercentageOfATR * 0.01, sDigits);
double MinPipStep = TPTrend;
int Target = Trend;
if(Trend == 0) {
for(na = 0;na < Attempt;na++) {
if(na > 0) {
Sleep(SleepForWait);
RefreshRates(); }
RVI = TRVI(sy, TrendTimeFrame, TrendPeriod, 0);
if(IsIndCalc) break; }
if(!IsIndCalc) {
Print("Pair: ", sy, " , TRVI not calculated!");
return(0); }
if(RVI > 0.0) Target = 1;
if(RVI < 0.0) Target = -1; }
if(Target != PrevTarget) NeedUpdateTP = true;
PrevTarget = Target;
for(na = 0;na < Attempt;na++) {
OK = False;
if(na > 0) {
RefreshRates();
sAsk = NormalizeDouble(MarketInfo(sy,MODE_ASK), sDigits);
sBid = NormalizeDouble(MarketInfo(sy,MODE_BID), sDigits); }
int SlipPage = ((sAsk - sBid)/sPoint/3.0);
int TypePrice = PRICE_CLOSE;
if(Target > 0) TypePrice = PRICE_LOW;
if(Target < 0) TypePrice = PRICE_HIGH;
double cci0 = iCCI(sy,PERIOD_M1,CCIPeriod,TypePrice,0);
double cci1 = iCCI(sy,PERIOD_M1,CCIPeriod,TypePrice,1);
bool NeedSell = (cci0 > CCIOverbought && cci0 < cci1) && (iHighest(sy, PERIOD_M1, MODE_HIGH, HLPeriod, 0) < 3);
bool NeedBuy = (cci0 < CCIOversold && cci0 > cci1) && (iLowest(sy, PERIOD_M1, MODE_LOW, HLPeriod, 0) < 3);
if(!NeedSell && !NeedBuy) { OK = True; break; }
if(NeedSell && Target > 0 && SellLots <= 0.0) { OK = True; break; }
if(NeedBuy && Target < 0 && BuyLots <= 0.0) { OK = True; break; }
if(NeedSell && SellLots > 0.0 && (sBid < (MaxSell + MinPipStep))) { OK = True; break; } // || sBid < (MaxSell + MinPipStep)
if(NeedBuy && BuyLots > 0.0 && (sAПоказано первые 50% кода (символов: 9549)
Что вы получите после оплаты
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? Адрес передаётся вместе с заказом в магазин и сохраняется для связи заказа с оплатой. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.
Стоимость полного кода: 955 ₽ (≈ $11.27 USDT)