Strategy Tester ReportEA_Pending_OrderMetaQuotes-Demo (Build 1361)
交易品种 EURUSD (Euro vs US Dollar) 时间周期 15 分钟图 2020.01.01 22:00 – 2020.09.06 23:45 (2020.01.01 – 2020.09.07) 复盘模型 每个即时价格(基于所有可利用的最小时段的每一个价格的分形插值计算) 参数 Name_EA=”PendingOrder”; Start_Hour=6; End_Hour=20; TP=20; SL=100; Lots=0.01; Distance=15; Magic=69; 经测试过的柱数 17538 用于复盘的即时价数量 464718 复盘模型的质量 90.00% 输入图表错误 0 起始资金 10000.00 点差 3 总净盈利 -68.07 总获利 131.99 总亏损 -200.06 盈利比 0.66 预期盈利 -0.08 绝对亏损 68.95 最大亏损 70.61 (0.71%) 相对亏损 0.71% (70.61) 交易单总计 860 卖单 (%获利百分比) 430 (74.19%) 买单 (%获利百分比) 430 (79.30%) 盈利交易(%占总百分比) 660 (76.74%) 亏损交易(%占总百分比) 200 (23.26%) 最大: 获利交易 0.21 亏损交易 -1.03 平均 获利交易 0.20 亏损交易 -1.00 最大: 连续获利金额 15 (3.00) 连续亏损金额 3 (-3.00) 最多: 连续获利次数 3.00 (15) 连续亏损次数 -3.00 (3) 平均: 连续获利 4 连续亏损 1
//+——————————————————————+
//| EA Pending Order.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+——————————————————————+
#property copyright “Copyright 2016, WidiPramana.”
#property link “https://www.mql5.com”
#property version “1.00”
#property strictextern string Name_EA = “PendingOrder”;
extern int Start_Hour = 6;
extern int End_Hour = 20;
extern int TP = 20;
extern int SL = 100;
extern double Lots = 0.01;
extern int Distance = 15;
extern int Magic = 69;double slb,tpb,sls,tps,pt;
int res,wt,wk,tiket,ticet;
//+——————————————————————+
//| expert initialization function |
//+——————————————————————+
int init()
{
//—-
if(Digits==3 || Digits==5) pt=10*Point; else pt=Point;
//—-
return(0);
}
//+——————————————————————+
//| expert deinitialization function |
//+——————————————————————+
int deinit()
{
//—-//—-
return(0);
}
//+——————————————————————+
//| expert start function |
//+——————————————————————+
int start()
{
label();if(Hour_trade()==1){
if(totalorder(2)==0){res=OrderSend(Symbol(), OP_BUYLIMIT,NR(Lots), Ask-Distance*Point, 3, Ask-Distance*Point-SL*Point,Ask-Distance*Point+TP*Point, “”, Magic, 0, Blue);}
if(totalorder(3)==0){res=OrderSend(Symbol(), OP_SELLLIMIT,NR(Lots) , Bid+Distance*Point, 3, Bid+Distance*Point+SL*Point,Bid+Distance*Point-TP*Point, “”, Magic, 0, Red);}
if(totalorder(4)==0){res=OrderSend(Symbol(), OP_BUYSTOP,NR(Lots) , Ask+Distance*Point, 3, Ask+Distance*Point-SL*Point,Ask+Distance*Point+TP*Point, “”, Magic, 0, Blue);}
if(totalorder(5)==0){res=OrderSend(Symbol(), OP_SELLSTOP,NR(Lots) , Bid-Distance*Point, 3, Bid-Distance*Point+SL*Point,Bid-Distance*Point-TP*Point, “”, Magic, 0, Red);}
}
return(0);
}
//+——————————————————————+int Hour_trade()
{
bool trade = false;
if(Start_Hour > End_Hour){
if (Hour() >= Start_Hour || Hour() < End_Hour) trade = true;
} else
if (Hour() >= Start_Hour && Hour() < End_Hour) trade = true;return (trade);
}int totalorder( int tipe)
{
int total=0;
for(int i=0; i<OrdersTotal(); i++)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=Magic || OrderType()!=tipe) continue;
total++;
}return(total);
}
double NR(double thelot)
{
double maxlots = MarketInfo(Symbol(), MODE_MAXLOT),
minilot = MarketInfo(Symbol(), MODE_MINLOT),
lstep = MarketInfo(Symbol(), MODE_LOTSTEP);
double lots = lstep * NormalizeDouble(thelot / lstep, 0);
lots = MathMax(MathMin(maxlots, lots), minilot);
return (lots);
}void label()
{
Comment(“\n “,
“\n “,
“\n ————————————————“,
“\n :: Pending+Order”,
“\n ————————————————“,
“\n :: Spread : “, MarketInfo(Symbol(), MODE_SPREAD),
“\n :: Leverage : 1 : “, AccountLeverage(),
“\n :: Equity : “, AccountEquity(),
“\n :: Hour Server :”, Hour(), “:”, Minute(),
“\n ————————————————“);
}
相关资源
暂无评论...