← К каталогу
Исходный код · ID 614

Sidus-Crossover-EA v3.20

sidus-ea-v3.20.mq4

Похожие материалы по тегам

coin_flip.mq4MQL4 / MetaTrader 4 · 2 общих теговindo run 1.5.mq4MQL4 / MetaTrader 4 · 2 общих теговoverdraftspazm v6.mq4MQL4 / MetaTrader 4 · 2 общих теговforex-flex-ea.mq4MQL4 / MetaTrader 4 · 2 общих теговadx_rsi_amp_atr_strategy_ea.mq4MQL4 / MetaTrader 4 · 2 общих теговichimoku ea.mq4MQL4 / MetaTrader 4 · 2 общих тегов
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Sidus-Crossover-EA v3.20 — торговый советник для платформы MetaTrader 4, написанный на языке MQL4. Эксперт использует пользовательский индикатор «sidus-crossover_signal» для генерации торговых сигналов на открытие и закрытие позиций, а также может задействовать дополнительные индикаторы Sniper Stop v2, Sniper Trend A и Sniper Trend B для фильтрации сигналов.

Советник поддерживает управление денежными средствами с возможностью автоматического расчёта размера лота на основе риска в процентах от баланса счёта, а также стратегию Мартингейл с настраиваемым множителем. Доступны функции трейлинг-стопа, безубытка и закрытия корзины ордеров при достижении заданной прибыли или убытка.

Встроенные фильтры включают временной фильтр по часам и дням недели, фильтр спреда и ограничение на количество одновременных ордеров. Торговые операции выполняются через стандартный API MetaTrader 4 с обработкой ошибок и повторными попытками отправки ордеров.

Настройки программы

НастройкаОписание
comment to display in the order (comment) Комментарий ордера — Текст комментария, отображаемого в открытых ордерах
s1 Разделитель: Управление средствами — Разделитель группы настроек управления денежными средствами
lots size (lots) Размер лота — Ручной размер лота для открытия позиций
enable risk management (lotsoptimized) Оптимизация лота — Включить автоматический расчёт размера лота на основе управления рисками
risk in percentage of the account (risk) Риск в процентах — Процент риска от баланса счёта, используемый при расчёте размера лота
enable the martingale (martingale) Мартингейл — Включить стратегию Мартингейл для увеличения лота после убыточных сделок
multiplier used for the martingale (multiplier) Множитель Мартингейл — Множитель увеличения лота при активной стратегии Мартингейл
minimum lot allowed by the expert (minlot) Минимальный лот — Минимально допустимый размер лота
maximum lot allowed by the expert (maxlot) Максимальный лот — Максимально допустимый размер лота
1 for minilot, 2 for microlot (lotdigits) Точность лота — Точность округления лота: 1 для минилота, 2 для микролота
enable the basket percent (basketpercent) Корзина по проценту — Включить закрытие корзины ордеров при достижении заданной прибыли или убытка в процентах от баланса
close all orders if a profit of 10 percents has been reached (profit) Прибыль в процентах — Процент прибыли от баланса, при достижении которого закрываются все ордера
close all orders if a loss of 30 percents has been reached (loss) Убыток в процентах — Процент убытка от баланса, при достижении которого закрываются все ордера
s2 Разделитель: Управление ордерами — Разделитель группы настроек управления ордерами
close the orders on an opposite signal (oppositeclose) Закрытие по противоположному сигналу — Автоматическое закрытие ордеров при появлении противоположного торгового сигнала
maximum trades allowed by the traders (maxtrades) Максимальное количество ордеров — Максимальное количество одновременно открытых ордеров
maximum trades per bar allowed by the expert (tradesperbar) Ордеров на бар — Максимальное количество ордеров, которое советник может открыть за один бар
long stop loss (long_stoploss) Стоп-лосс лонг — Значение стоп-лосса для лонг-позиций в пунктах
short stop loss (short_stoploss) Стоп-лосс шорт — Значение стоп-лосса для шорт-позиций в пунктах
long take profit (long_takeprofit) Тейк-профит лонг — Значение тейк-профита для лонг-позиций в пунктах
short take profit (short_takeprofit) Тейк-профит шорт — Значение тейк-профита для шорт-позиций в пунктах
profit in pips required to enable the trailing stop (trailingstart) Начало трейлинга — Прибыль в пунктах, необходимая для активации трейлинг-стопа
trailing stop (trailingstop) Трейлинг-стоп — Расстояние трейлинг-стопа от текущей цены в пунктах
margin allowed to the market to enable the trailing stop (trailingstep) Шаг трейлинга — Допустимый отступ цены от стоп-лосса для активации трейлинг-стопа
gain in pips required to enable the break even (breakevengain) Прибыль для безубытка — Прибыль в пунктах, необходимая для активации функции безубытка
break even (breakeven) Безубыток — Уровень безубытка в пунктах, при котором стоп-лосс перемещается в безубыток
bar in the past to take in consideration for the signal (shift) Сдвиг бара для сигнала — Количество баров в прошлом, учитываемых при формировании торгового сигнала
s4 Разделитель: Временной фильтр — Разделитель группы настроек временного фильтра
gmt offset of the broker (gmtshift) Смещение GMT брокера — Смещение GMT часового пояса брокера для корректировки торговых часов
enable time filter (filter) Временной фильтр — Включить временной фильтр для ограничения торговли по часам
start to trade after this hour (start) Час начала торговли — Час начала разрешённой торговой сессии
stop to trade after this hour (end) Час окончания торговли — Час окончания разрешённой торговой сессии
trade on sunday (tradesunday) Торговля в воскресенье — Разрешить торговлю в воскресенье
enable special time filter on friday (fridayfilter) Фильтр пятницы — Включить специальный временной фильтр для пятницы
stop to trade after this hour (fridayend) Час окончания торговли в пятницу — Час окончания торговли в пятницу при включённом пятничном фильтре
Получить полный код

Поиск по коду файла

#property description "Sidus-Crossover-EA v3.20 (2020)"
extern string comment="Sidus-EA"; // comment to display in the order
extern string s1="Money Management";
extern double lots=0.01;                  // lots size
extern bool lotsoptimized=false;  // enable risk management
extern double risk=1;             // risk in percentage of the account
extern bool martingale=false;     // enable the martingale
extern double multiplier=1.5;     // multiplier used for the martingale
extern double minlot=0.01;        // minimum lot allowed by the expert
extern double maxlot=0.04;        // maximum lot allowed by the expert
extern double lotdigits=2;        // 1 for minilot, 2 for microlot
extern bool basketpercent=false;  // enable the basket percent
extern double profit=10;          // close all orders if a profit of 10 percents has been reached
extern double loss=30;            // close all orders if a loss of 30 percents has been reached
extern string s2="Order Management";
extern bool oppositeclose=true;   // close the orders on an opposite signal
bool reversesignals=false;        // reverse the signals, long if short, short if long
extern int maxtrades=100;         // maximum trades allowed by the traders
extern int tradesperbar=1;        // maximum trades per bar allowed by the expert
extern int long_stoploss=80;      // long stop loss
extern int short_stoploss=80;     // short stop loss
extern int long_takeprofit=700;   // long take profit
int long_takeprofit2=0;           // long take profit 2
int long_takeprofit3=0;           // long take profit 3
int long_takeprofit4=0;           // long take profit 4
int long_takeprofit5=0;           // long take profit 5
extern int short_takeprofit=700;  // short take profit
int short_takeprofit2=0;          // short take profit 2
int short_takeprofit3=0;          // short take profit 3
int short_takeprofit4=0;          // short take profit 4
int short_takeprofit5=0;          // short take profit 5
extern int trailingstart=100;     // profit in pips required to enable the trailing stop
extern int trailingstop=50;       // trailing stop
extern int trailingstep=50;       // margin allowed to the market to enable the trailing stop
extern int breakevengain=0;       // gain in pips required to enable the break even
extern int breakeven=0;           // break even
int expiration=0;                 // expiration in minutes for pending orders
int slippage=0;                   // maximum difference in pips between signal and order
double maxspread=70;              // maximum spread allowed by the expert
bool open5orders=false;           // true=open five orders as per the rule with different sl and tp, false=open one order with buystop (sl) and buytarget (tp)
bool closeonbadconditions=false;  // true=close the orders if all conditions are not met anymore, false=don't close the orders if all conditions are not met anymore
bool closeonarrows=false;         // true=we exit on arrows
bool autostop=false;              // true=stoploss based on the sniper stopv2, false=stoploss not based on the sniper stop v2
int autostopmargin=0;             // margin to add to the autostop, positive value=value to add, negative value=value to withdraw
int minimumstop=300;              // minimum stop loss when autostop is enabled
int maximumstop=1000;             // maximum stop loss when autostop is enabled
bool notradeovermaxstop=false;    // true=don't trade if the distance between the price and the sniper stop v2 is higher thanmaximumstop, false=disregard this distance
bool trailonsniperstop=false;     // true=trailing stop based on the sniper stop v2, false=trailingstop not based on the sniper stop v2
bool onlycross=false;             // true=enter only as soon as the conditions are met, false=enter as longs as the conditions are met
bool usesniper=true;              // true=use sniper indicator for the signal, false=don't use this indicator for the signal
int SniperPeriod=30;              // period of the sniper indicator
int SniperType=3;                 // type of the sniper indicator
int arrow_shift=30;               // shift of the sniper indicator's arrow
int Alerts=1;                     // alerts of the sniper indicator
bool usestop=false;               // true=use the sniper stop v2 indicator for the signal, false=don't use this indicator for the signal
bool usetrenda=false;             // true=use the sniper trend a indicator for the signal, false=don't use this indicator for the signal
bool usetrendb=false;             // true=use the sniper trend b indicator for the signal, false=don't use this indicator for the signal
double Sniper=0.01;               // sniper value of the sniper trend b indicator
double SniperSS=0.1;              // sniperss value of the sniper trend b indicator
int SniperP=7;                    // sniperp value of the sniper trend b indicator
bool AlertsEnabled=false;         // true=enable the alerts of the sniper trend b indicator, false=disable the alerts
extern int shift=0;               // bar in the past to take in consideration for the signal
bool usefilter=false;             // enable a second sniper system on another timeframe to filter the signals
int timeframe=240;                // timeframe of the filter
bool onlycrosstf=false;           // true=enter only as soon as the conditions are met, false=enter as longs as the conditions are met
bool usesnipertf=true;            // true=use sniper indicator for this filter, false=don't use this indicator for the filter
int SniperPeriodtf=30;            // period of the sniper indicator
int SniperTypetf=3;               // type of the sniper indicator
int arrow_shifttf=30;             // shift of the sniper indicator's arrow
int Alertstf=1;                   // alerts of the sniper indicator
bool usestoptf=false;             // true=use the sniper stop v2 indicator for the filter, false=don't use this indicator for the filter
bool usetrendatf=false;           // true=use the sniper trend a indicator for the filter, false=don't use this indicator for the filter
bool usetrendbtf=false;           // true=use the sniper trend b indicator for the filter, false=don't use this indicator for the filter
double Snipertf=0.01;             // sniper value of the sniper trend b indicator
double SniperSStf=0.1;            // sniperss value of the sniper trend b indicator
int SniperPtf=7;                  // sniperp value of the sniper trend b indicator
bool AlertsEnabledtf=true;        // true=enable the alerts of the sniper trend b indicator, false=disable the alerts
bool samedirection=true;          // true=we continue to open orders if a new signal in the same direction than the previous appears, false=the EA will wait the opposite signal to enter new trades
bool minclosetime=false;          // true=we close the trade only after a certain time (mincloseminutes), false=disregard the time
int mincloseminutes=61;           // minimum time determined in minutes

extern string s4="Time Filter";
extern int gmtshift=2;            // gmt offset of the broker
extern bool filter=false;         // enable time filter
extern int start=4;               // start to trade after this hour
extern int end=20;                // stop to trade after this hour
extern bool tradesunday=true;     // trade on sunday
extern bool fridayfilter=false;   // enable special time filter on friday
extern int fridayend=24;          // stop to trade after this hour
datetime t0,t1,lastbuyopentime,lastsellopentime;
double lastbuyopenprice,lastsellopenprice,lastbuyprofit,lastsellprofit,lastprofit;
double lotsfactor=1,initiallotsfactor=1,ilots,lastbuylot,lastselllot,lastlot,mlots;
double ask,bid,cb,sl,tp,min,max;
int i,bc=-1,tpb,tps,cnt,istart,iend,total,ticket;
int lastorder,buyorderprofit,sellorderprofit,history,iSignal,iTrend;
int MagicNumber;
int directioninstance=0;
double pt,mt;
int dg;
int init()
  {
      // код доступен только после оплаты
   }
int start(){
      // код доступен только после оплаты
   }

   GlobalVariableSet("vGrafBalance",AccountBalance());
   GlobalVariableSet("vGrafEquity",AccountEquity());

   RefreshRates();
   ask=MarketInfo(Symbol(),MODE_ASK);
   bid=MarketInfo(Symbol(),MODE_BID);

   if(breakevengain>0)movebreakeven(breakevengain,breakeven);
   if(trailingstop>0)movetrailingstop(trailingstart,trailingstop);
   if(trailonsniperstop){

      double STBs=iCustom(Symbol(),0,"sidus-crossover_signal",0,shift);
      double STRs=iCustom(Symbol(),0,"sidus-crossover_signal",1,shift);
      for(i=0;i<OrdersTotal();i++){
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         if(OrderType()<=OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber){
            if(OrderType()==OP_BUY){
               if(((NormalizeDouble(OrderStopLoss(),dg)<NormalizeDouble(STBs,dg))||(OrderStopLoss()==0)) && STBs!=0 && STBs!=EMPTY_VALUE
               && NormalizeDouble((Ask-STBs)/pt,dg)>=MarketInfo(Symbol(),MODE_STOPLEVEL)){
                  OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(STBs,dg),OrderTakeProfit(),0,Blue);
                  return(0);
               }
            }
            else{
               if(((NormalizeDouble(OrderStopLoss(),dg)>NormalizeDouble(STRs,dg))||(OrderStopLoss()==0)) && STRs!=0 && STRs!=EMPTY_VALUE
               && NormalizeDouble((STRs-Bid)/pt,dg)>=MarketInfo(Symbol(),MODE_STOPLEVEL)){                 
                  OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(STRs,dg),OrderTakeProfit(),0,Red);
                  return(0);
               }
            }
         }
      }
   }
   if(basketpercent)closebasketpercent(profit,loss);

   lastbuylot=0;
   lastselllot=0;
   lastorder=0;

   history=OrdersHistoryTotal();
   if(history>0){
      for(i=0;i<history;i++){
         OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber){
            lastprofit=OrderProfit();
            lastlot=OrderLots();
            if(OrderType()==OP_BUY){
               lastbuyprofit=OrderProfit();
               lastbuylot=OrderLots();
               lastorder=1;
            }
            if(OrderType()==OP_SELL){
               lastsellprofit=OrderProfit();
               lastselllot=OrderLots();
               lastorder=2;
            }
         }
      }
   }
   mlots=0;
   if(martingale && lastprofit<0)mlots=NormalizeDouble(lastlot*multiplier,lotdigits);else mlots=lots;

   total=OrdersTotal();
   if(total>0){
      for(i=0;i<total;i++){
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && OrderCloseTime()==0){
            if(OrderType()==OP_BUY){
               lastbuyopentime=OrderOpenTime();
               lastbuyopenprice=OrderOpenPrice();
               buyorderprofit=OrderProfit();
            }
            if(OrderType()==OP_SELL){
               lastsellopentime=OrderOpenTime();
               lastsellopenprice=OrderOpenPrice();
               sellorderprofit=OrderProfit();
            }
         }
      }
   } 

   if(tradesperbar==1 && (((TimeCurrent()-lastbuyopentime)<Period()) || ((TimeCurrent()-lastsellopentime)<Period()))){tpb=1;tps=1;}
   if(bc!=Bars){tpb=0;tps=0;bc=Bars;}

   if(usesniper){
      double SNI0=iCustom(Symbol(),0,"sidus-crossover_signal",0,shift);
      double SNI1=iCustom(Symbol(),0,"sidus-crossover_signal",1,shift);

   }
   if(usestop || autostop){
      double STB=iCustom(Symbol(),0,"Sniper Stop_v2",0,shift);double STR=iCustom(Symbol(),0,"Sniper Stop_v2",1,shift);
      double STBa=iCustom(Symbol(),0,"Sniper Stop_v2",0,shift+1);double STRa=iCustom(Symbol(),0,"Sniper Stop_v2",1,shift+1);
   }
   if(usetrenda){
      double TAB=iCustom(Symbol(),0,"Sniper Trend A",0,shift);double TAR=iCustom(Symbol(),0,"Sniper Trend A",1,shift);
      double TABa=iCustom(Symbol(),0,"Sniper Trend A",0,shift+1);double TARa=iCustom(Symbol(),0,"Sniper Trend A",1,shift+1);
   }
   if(usetrendb){
      double TBB=iCustom(Symbol(),0,"Sniper Trend B",Sniper,SniperSS,SniperP,AlertsEnabled,1,shift);double TBR=iCustom(Symbol(),0,"Sniper Trend B",Sniper,SniperSS,SniperP,AlertsEnabled,0,shift);
      double TBBa=iCustom(Symbol(),0,"Sniper Trend B",Sniper,SniperSS,SniperP,AlertsEnabled,1,shift+1);double TBRa=iCustom(Symbol(),0,"Sniper Trend B",Sniper,SniperSS,SniperP,AlertsEnabled,0,shift+1);
   }

   double signal=0;
   double signala=0;

   if((usesniper==false || (usesniper && SNI0<350))
   && (usestop==false || (usestop && STB<350)) && (usetrenda==false || (usetrenda && TAB!=0)) && (usetrendb==false || (usetrendb && TBB!=0)))signal=1;
   if((usesniper==false || (usesniper && SNI1<350))
   && (usestop==false || (usestop && STR<350)) && (usetrenda==false || (usetrenda && TAR!=0)) && (usetrendb==false || (usetrendb && TBR!=0)))signal=2;

   if(usefilter){
      if(usesniper){
         double SNI0tf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,0,shift);
         double SNI2tf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,2,shift);
         double SNI4tf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,4,shift);
         double SNI1tf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,1,shift);
         double SNI3tf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,3,shift);
         double SNI5tf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,5,shift);

         double SNI0atf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,0,shift+1);
         double SNI2atf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,2,shift+1);
         double SNI4atf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,4,shift+1);
         double SNI1atf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,1,shift+1);
         double SNI3atf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,3,shift+1);
         double SNI5atf=iCustom(Symbol(),timeframe,"Sniper",SniperPeriodtf,SniperTypetf,arrow_shifttf,Alertstf,5,shift+1);
      }
      if(usestoptf){
         double STBtf=iCustom(Symbol(),timeframe,"Sniper Stop_v2",0,shift);double STRtf=iCustom(Symbol(),timeframe,"Sniper Stop_v2",1,shift);
         double STBatf=iCustom(Symbol(),timeframe,"Sniper Stop_v2",0,shift+1);double STRatf=iCustom(Symbol(),timeframe,"Sniper Stop_v2",1,shift+1);
      }

      if(usetrendatf){
         double TABtf=iCustom(Symbol(),timeframe,"Sniper Trend A",0,shift);double TARtf=iCustom(Symbol(),timeframe,"Sniper Trend A",1,shift);
         double TABatf=iCustom(Symbol(),timeframe,"Sniper Trend A",0,shift+1);double TARatf=iCustom(Symbol(),timeframe,"Sniper Trend A",1,shift+1);
      }

      if(usetrendbtf){
         double TBBtf=iCustom(Symbol(),tim

Показано первые 50% кода (символов: 24697)

Открыть по тарифу

Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.

Разовая покупка файла

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
2 469,70₽ ≈ $30.18