led_ea.mq4
Похожие материалы по тегам
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «led_ea.mq4» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
О программе
Данный советник для MetaTrader 4 построен на анализе пересечения двух экспоненциальных скользящих средних (EMA) с коротким и длинным периодами. На основании соотношения значений EMA определяется направление тренда и принимается решение об открытии покупающей или продающей позиции. Советник позволяет открывать ордера как при немедленном входе в тренд, так и при реальном пересечении EMA.
В продукт включены функции управляемого риска: расчёт размера лота на основе свободного баланса счёта, поддержка стоп-лосса, тейк-профита и трейлинг-стопа. Также реализована система хеджирования — при убыточной позиции автоматически открывается встречный ордер с собственными параметрами защиты.
Советник поддерживает ограничение торгового времени по часам, работу с микросчётом и суммарный вывод настроек в комментарий графика. Все торговые операции выполняются через стандартные API функций OrderSend и OrderModify платформы MetaTrader 4.
Поиск по коду файла
deinit() {//----//---- return(0); } bool isNewSumbol(string current_symbol) { //loop through all the opened order and compare the symbols int total = OrdersTotal(); for(int cnt = 0 ; cnt < total ; cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); string selected_symbol = OrderSymbol(); if (current_symbol == selected_symbol) return (False); } return (True);}int Crossed() { double EmaLongPrevious = iMA(NULL,0,LongEma,0,MODE_EMA, PRICE_CLOSE, 1); double EmaLongCurrent = iMA(NULL,0,LongEma,0,MODE_EMA, PRICE_CLOSE, 0); double EmaShortPrevious = iMA(NULL,0,ShortEma,0,MODE_EMA, PRICE_CLOSE, 1); double EmaShortCurrent = iMA(NULL,0,ShortEma,0,MODE_EMA, PRICE_CLOSE, 0); if(ImmediateTrade) { if (EmaShortCurrent<EmaLongCurrent)return (1); //down trend if (EmaShortCurrent>EmaLongCurrent)return (2); //up trend } if (EmaShortPrevious>EmaLongPrevious && EmaShortCurrent<EmaLongCurrent ) return (1); //down trend if (EmaShortPrevious<EmaLongPrevious && EmaShortCurrent>EmaLongCurrent ) return (2); //up trend return (0); //elsewhere }//--- Bassed on Alex idea! More ideas are comingdouble LotSize(){ double lotMM = MathCeil(AccountFreeMargin() * Risk / 1000) / 100; if(AccountIsMicro==false) //normal account { if (lotMM < 0.1) lotMM = Lots; if ((lotMM > 0.5) && (lotMM < 1)) lotMM=0.5; //Thanks cucurucu if (lotMM > 1.0) lotMM = MathCeil(lotMM); if (lotMM > 100) lotMM = 100; } else //micro account { if (lotMM < 0.01) lotMM = Lots; if (lotMM > 1.0) lotMM = MathCeil(lotMM); if (lotMM > 100) lotMM = 100; } return (lotMM);}string BoolToStr ( bool value){ if(value) return ("True"); else return ("False");}void Print_Details(){ string sComment = ""; string sp = "----------------------------------------\n"; string NL = "\n"; sComment = sp; sComment = sComment + "TakeProfit=" + DoubleToStr(TakeProfit,0) + " | "; sComment = sComment + "TrailingStop=" +
DoubleToStr(TrailingStop,0) + " | "; sComment = sComment + "StopLoss=" + DoubleToStr(StopLoss,0) + " | "; sComment = sComment + "UseStopLoss=" + BoolToStr(UseStopLoss) + NL; sComment = sComment + sp; sComment = sComment + "ImmediateTrade=" + BoolToStr(ImmediateTrade) + " | "; sComment = sComment + "CounterTrend=" + BoolToStr(CounterTrend) + " | " ; if(UseHourTrade) { sComment = sComment + "UseHourTrade=" + BoolToStr(UseHourTrade) + " | "; sComment = sComment + "FromHourTrade=" + DoubleToStr(FromHourTrade,0) + " | "; sComment = sComment + "ToHourTrade=" + DoubleToStr(ToHourTrade,0) + NL; } else { sComment = sComment + "UseHourTrade=" + BoolToStr(UseHourTrade) + NL; } sComment = sComment + sp; sComment = sComment + "Lots=" + DoubleToStr(Lots,0) + " | "; sComment = sComment + "UseMoneyManagement=" + BoolToStr(UseMoneyManagement) + " | "; sComment = sComment + "AccountIsMicro=" + BoolToStr(AccountIsMicro) + " | "; sComment = sComment + "Risk=" + DoubleToStr(Risk,0) + "%" + NL; sComment = sComment + sp; Comment(sComment);}void Print_Details_Summarized(){ string sComment = ""; string sp = "----------------------------------------\n"; string NL = "\n"; sComment = sp; sComment = sComment + "TF=" + DoubleToStr(TakeProfit,0) + " | "; sComment = sComment + "TS=" + DoubleToStr(TrailingStop,0) + " | "; sComment = sComment + "SL=" + DoubleToStr(StopLoss,0) + " | "; sComment = sComment + "USL=" + BoolToStr(UseStopLoss) + NL; sComment = sComment + sp; sComment = sComment + "IT=" + BoolToStr(ImmediateTrade) + " | "; sComment = sComment + "CT=" + BoolToStr(CounterTrend) + " | " ; if(UseHourTrade) { sComment = sComment + "UHT=" + BoolToStr(UseHourTrade) + " | "; sComment = sComment + "FHT=" + DoubleToStr(FromHourTrade,0) + " | "; sComment = sComment + "THT=" + DoubleToStr(ToHourTrade,0) + NL; } else { sComment = sComment + "UHT=" + BoolToStr(UseHourTrade) + NL; } sComment = sComment + sp; sComment = sComment + "L=" + DoubleToStr(Lot
s,0) + " | "; sComment = sComment + "MM=" + BoolToStr(UseMoneyManagement) + " | "; sComment = sComment + "AIM=" + BoolToStr(AccountIsMicro) + " | "; sComment = sComment + "R=" + DoubleToStr(Risk,0) + "%" + NL; sComment = sComment + sp; Comment(sComment);}//+------------------------------------------------------------------+//| expert start function |//+------------------------------------------------------------------+int start() {
// код доступен только после оплаты
}//---- if (UseHourTrade) { if (!(Hour()>=FromHourTrade && Hour()<=ToHourTrade)) { Comment("Time for trade has not come yet!"); return(0); } } int cnt, ticket, ticket2, total; string comment = ""; if(CounterTrend==true) comment = "EMAC_Counter"; if(CounterTrend==false) comment = "EMAC_Pro"; if(ImmediateTrade==true) comment = comment + "_Immediate"; if(ImmediateTrade==false) comment = comment + "Postponed"; if(Bars<100) Показано первые 50% кода (символов: 7418)
Открыть по тарифу
Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.
Разовая покупка файла
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? После подтверждения оплаты файл сохранится в кабинете на этот email. Если аккаунта ещё нет, мы создадим его и пришлём ссылку для задания пароля. Если аккаунт уже есть, покупка добавится в него. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.