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

icustom-ea-v3.15.mq4

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

ea robofibo source v.11.2.mq4MetaTrader 4 · 1 общих теговsma crossover scalper ea for mt4.mq4MetaTrader 4 · 1 общих теговr15 pivot points expert advisor by @fundedmillionairess.mq4MetaTrader 4 · 1 общих теговnewstrader.mq5MetaTrader 5 · 1 общих теговmm3.0_flip_codepro_v3.1_with_cooldown@lifeindreamsworld.mq5MetaTrader 5 · 1 общих теговmm3.0_flip_codepro_v3.1_with_cooldown.mq5MetaTrader 5 · 1 общих тегов
Вы автор или правообладатель?

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

Получить полный код

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

#property version   "v3.15 - 2020"
#property description "iCustom-EA"

extern string comment="iCustom-EA";      // comment to display in the order
extern string IndicatorName = "Super Arrrow Indicator";
extern int BuyBuffer = 0;
extern int SellBuffer = 1;

extern string moneymanagement="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 double minlot=0.01;               // minimum lot allowed by the expert
extern double maxlot=10;                 // maximum lot allowed by the expert
extern double lotdigits=2;               // 1 for minilot, 2 for microlot

extern string ordersmanagement="Order Management";

extern bool oppositeclose=true;          // close the orders on an opposite signal
extern 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 lstoploss=30;                 // long stop loss
extern int sstoploss=30;                 // short stop loss
extern int ltakeprofit=40;                // long take profit
extern int ltakeprofit2=0;               // long take profit 2
extern int ltakeprofit3=0;               // long take profit 3
extern int ltakeprofit4=0;               // long take profit 4
extern int ltakeprofit5=0;               // long take profit 5
extern int stakeprofit=50;                // short take profit
extern int stakeprofit2=0;               // short take profit 2
extern int stakeprofit3=0;               // short take profit 3
extern int stakeprofit4=0;               // short take profit 4
extern int stakeprofit5=0;               // short take profit 5
extern int trailingstart=30;            // profit in pips required to enable the trailing stop
extern int trailingstop=40;             // trailing stop
extern int trailingstep=25;               // 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=50;                    // maximum spread allowed by the expert

extern string advordersmanagement="Advanced Order Management";

extern 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)
extern 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
extern bool closeonarrows=false;         // true=we exit on arrows
extern bool autostop=false;              // true=stoploss based on the sniper stopv2, false=stoploss not based on the sniper stop v2
extern int autostopmargin=0;             // margin to add to the autostop, positive value=value to add, negative value=value to withdraw
extern int minimumstop=300;              // minimum stop loss when autostop is enabled
extern int maximumstop=1000;             // maximum stop loss when autostop is enabled
extern 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
extern bool trailonsniperstop=false;      // true=trailing stop based on the sniper stop v2, false=trailingstop not based on the sniper stop v2

extern string entrylogics="Entry Logics";

extern bool onlycross=false;             // true=enter only as soon as the conditions are met, false=enter as longs as the conditions are met
extern bool usesniper=true;              // true=use sniper indicator for the signal, false=don't use this indicator for the signal
extern int SniperPeriod=30;              // period of the sniper indicator
extern int SniperType=3;                 // type of the sniper indicator
extern int arrow_shift=30;               // shift of the sniper indicator's arrow
extern int Alerts=1;                     // alerts of the sniper indicator
extern bool usestop=false;               // true=use the sniper stop v2 indicator for the signal, false=don't use this indicator for the signal
extern bool usetrenda=false;             // true=use the sniper trend a indicator for the signal, false=don't use this indicator for the signal
extern bool usetrendb=false;             // true=use the sniper trend b indicator for the signal, false=don't use this indicator for the signal
extern double Sniper=0.01;               // sniper value of the sniper trend b indicator
extern double SniperSS=0.1;              // sniperss value of the sniper trend b indicator
extern int SniperP=7;                    // sniperp value of the sniper trend b indicator
extern bool AlertsEnabled=false;         // true=enable the alerts of the sniper trend b indicator, false=disable the alerts
extern int shift=1;                      // bar in the past to take in consideration for the signal

extern string filersettings="Filter Settings";

extern bool usefilter=false;             // enable a second sniper system on another timeframe to filter the signals
extern int timeframe=240;                // timeframe of the filter
extern bool onlycrosstf=false;           // true=enter only as soon as the conditions are met, false=enter as longs as the conditions are met
extern bool usesnipertf=true;            // true=use sniper indicator for this filter, false=don't use this indicator for the filter
extern int SniperPeriodtf=30;            // period of the sniper indicator
extern int SniperTypetf=3;               // type of the sniper indicator
extern int arrow_shifttf=30;             // shift of the sniper indicator's arrow
extern int Alertstf=1;                   // alerts of the sniper indicator
extern bool usestoptf=false;             // true=use the sniper stop v2 indicator for the filter, false=don't use this indicator for the filter
extern bool usetrendatf=false;           // true=use the sniper trend a indicator for the filter, false=don't use this indicator for the filter
extern bool usetrendbtf=false;           // true=use the sniper trend b indicator for the filter, false=don't use this indicator for the filter
extern double Snipertf=0.01;             // sniper value of the sniper trend b indicator
extern double SniperSStf=0.1;            // sniperss value of the sniper trend b indicator
extern int SniperPtf=7;                  // sniperp value of the sniper trend b indicator
extern bool AlertsEnabledtf=false;       // true=enable the alerts of the sniper trend b indicator, false=disable the alerts

extern string extrafeatures="Extra Features";

extern 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
extern bool minclosetime=false;          // true=we close the trade only after a certain time (mincloseminutes), false=disregard the time
extern int mincloseminutes=61;           // minimum time determined in minutes

extern string timefilter="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;
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,"Sniper Stop_v2",0,shift);
      double STRs=iCustom(Symbol(),0,"Sniper Stop_v2",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);
               }
            }
         }
      }
   }

/*
   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()==magic){
            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()==magic && 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, IndicatorName,BuyBuffer,shift); //BUY
      double SNI1=iCustom(Symbol(),0, IndicatorName,SellBuffer,shift); //SELL

   }
   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(),timeframe,"Sniper Trend B",Snipertf,SniperSStf,SniperPtf,AlertsEnabledtf,1,shift);
         double TBRtf=iCustom(Symbol(),timeframe,"Sniper Trend B",Snipertf,SniperSStf,SniperPtf,AlertsEnabledtf,0,shift);
         double TBBatf=iCustom(Symbol(),timeframe,"Sniper Trend B",Snipertf,SniperSStf,SniperPtf,AlertsEnabledtf,1,shift+1);
         double TBRatf=iCustom(Symbol(),timeframe,"Sniper Trend B",Snipertf,SniperSStf,SniperPtf,Alerts

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

Что вы получите после оплаты

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

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

Стоимость полного кода: 2 588 ₽