"

Auto Pending and Manage Orders by RSI – expert for MetaTrader 4

by FlorenciaAsche
Views:
8775
Rating:



votes: 9

autopendingbyrsi.mq4
(forty five.fifty two KB)view

Description:

  1. Auto pending orders by RSI;
  2. Lower danger at weekend and restore place the subsequent week;
  3. Mail some helpful info.

Recommendations:

1. Set testmode true for backtest, false for actual mode:

extern bool testmode = false;//true:for backtest

2. If in testmode,please set solely one of many tradesymbol array,for instance:

extern string tradesymbol1 = "EURUSDm_802_2802_1602_200_860";
extern string tradesymbol2 = "";
extern string tradesymbol3 = "";
extern string tradesymbol4 = "";
extern string tradesymbol5 = "";
extern string tradesymbol6 = "";

if in actual account mode, set testmode false,and config tradesymbol like (use “,” to separate symbols,use “_” to separate a logo’s parameters):

extern string tradesymbol1 = "EURUSDm_802_2802_1602_200_860,USDCHFm_506_2606_1506_120_600";
extern string tradesymbol2 = "USDJPYm_460_2802_1302_100_320";
extern string tradesymbol3 = "";
extern string tradesymbol4 = "";
extern string tradesymbol5 = "";
extern string tradesymbol6 = "";

EURUSDm_802_2802_1602_200_860 means:

  • image: EURUSDm(m means my exness mini account,probably it is best to modify to your personal image)
  • pendingpips:802(pending hole)
  • weekendpluspips:2802(widen plus hole at weekend)
  • cancelpips:1602(when the hole exceed this pips,shut the pending order)
  • trailingsl:200(trailing cease loss)
  • takeprofit:860(digital take revenue)

3. If you need to delete pending orders at weekend, set weekenddelete=true, else if you wish to widen pending hole and restore it the subsequent week, please set weekenddelete=false.

extern bool weekenddelete = false;//true:delete false:modify

4. Weekend mode start and finish time (5 means Friday,7 means Sunday (the time is GMT,perhaps it is best to modify together with your native time,the default parameters run nicely in Beijing Time):

//buying and selling finish time in friday
extern int weekendbeginday = 5;
extern string weekendbegintime = "20:30";//friday 20:30
extern int weekendendday = 7;
extern string weekendendtime = "23:30";//sunday 20:30

5. All symbols (perhaps not commerce image) you need to mail the RSI worth immediate (>70 or <30) and periodically report back to you.clearly, you need to modify the AUDJPYm in case your account shouldn’t be mini one.

string symbolsstr1 = "AUDJPYm,AUDCADm,AUDCHFm,AUDNZDm,AUDSGDm,AUDUSDm,CADCHFm,CADHKDm,CADJPYm,CHFJPYm,CHFPLNm,CHFSGDm,EURAUDm,EURBRLm,EURCADm,EURCHFm,EURDKKm,EURGBPm,EURHKDm,EURHUFm,EURJPYm,EURMXNm";
string symbolsstr2 = "GBPCHFm,GBPJPYm,GBPNZDm,GBPUSDm,HKDJPYm,HUFJPYm,MXNJPYm,NZDCADm,NZDCHFm,NZDJPYm,NZDSGDm,NZDUSDm,SGDJPYm,USDBRLm,USDCADm,USDCHFm,USDCZKm,USDDKKm,USDHKDm,USDHUFm,USDJPYm,USDMXNm";
string symbolsstr3 = "EURNOKm,EURNZDm,EURPLNm,EURRUBm,EURSEKm,EURSGDm,EURTRYm,EURUSDm,EURZARm,GBPAUDm,GBPCADm,USDNOKm,USDPLNm,USDRONm,USDRUBm,USDSEKm,USDSGDm,USDTRYm,USDZARm,XAGUSDm,XAUUSDm,ZARJPYm";
lengthy sendmininterval = 3600;

 6. RSI configuration:

//rsi
extern int rsitimeframe = PERIOD_H4;
extern int rsiperiod  = 14;
extern ENUM_APPLIED_PRICE rsiappliedprice = PRICE_CLOSE;
extern int rsishift = 0;
extern double rsiupperline = 70;
extern double rsilowerline = 30;

7. Use the magicweekendexpiration to determine the weekend mode,if anybody has higher method please kindly inform me

int magicweekendexpiration = 1577836800;//2020-1-1 0:0:0 intvalue:1577836800

8. Others:

If modify to weekend mode failed, the EA will ship a mail and check out MAX_MODIFY_TRY_TIME(one hundred default) occasions until success.

No cease loss utilized, and if little loss order (min purchase or max promote order) of 1 image exceed pendingpips, the EA will pend one other order of the identical image.

In check mode, if the fairness lower than ninety five% of stability, EA will write the standing to warning information.

if(((AccountEquity()/AccountBalance()) < 0.ninety five))
        
            WriteToWarningFile();
        

If you will have discovered any bugs or have strategies, please kindly let me know.

Source URL:https://www.mql5.com/en/code/11684

Share this article

Leave a comment