有您的持续关注
我们会做得更好

智能交易系统 botoupi EA



botoupi EA从名字中文拼音就看得出是属于剥头皮类型的EA,策略也简单到无语:Close[1]>Close[2]买,Close[1]<Close[2]卖。也就是比较前面两根K线的收盘价格进行多空交易。

本网收集整理智能交易EA仅为MQL4编程爱好者提供语法及相关编程技巧的学习研究之用,智能交易存在极高的风险测试请用模拟盘,请勿用于实盘。botoupi EA源码:

//+------------------------------------------------------------------+
//|                                                      botoupi.mq4 |
//|                                     Copyright 2014, QQ:125808047 |
//+------------------------------------------------------------------+
#property copyright "www.125808047.com"
#property link      "http://www.125808047.com/"

#include <stdlib.mqh>

extern double Lots = 1.0;
extern double TakeProfit = 100;
extern double Stoploss = 170;
extern double TrailingStop = 90;
extern double Slippage = 20;
extern double risk = 5.0;
extern double Pips = 16;
extern double Perc = 5;
double Points;
bool cg = false;
//int color arrow_color=CLR_NONE;

int init ()
{
Points = MarketInfo (Symbol(), MODE_POINT);
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
Comment("www.125808047.com");
return(0);
}
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
double Levv=0;
int cnt=0, total;

if(Bars<10)
{
Print("bars less than 100");
return(0);
} 
if(OrdersTotal()<1)
{
if(AccountFreeMargin()<(1*Lots))
{
Print("BrokeAsAJoke");
return(0);
}
Levv= (MathCeil(AccountEquity() * risk / 10000)/10);


// (BUY)
if (Close[1]>Close[2])
{
cg = OrderSend(Symbol(),OP_BUY,Levv,Bid,Slippage,Bid-Stoploss*Points,Ask+TakeProfit*Points,0,0,Red);
return(0);
}

// (SELL)
if (Close[1]<Close[2])
{
cg = OrderSend(Symbol(),OP_SELL,Levv,Ask,Slippage,Ask+Stoploss*Points,Bid-TakeProfit*Points,0,0,Red);
return(0);
}
}

total=OrdersTotal();
for(cnt=0;cnt<OrdersTotal();cnt++)
{
cg = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUY)
{
//if((OrderOpenTime() - (CurTime() >= 300))|| (AccountProfit() >2))
if((TimeCurrent() - OrderOpenTime() >= 300) || (AccountProfit() >2))
{
cg = OrderClose(OrderTicket(),OrderLots(),Ask,0,Violet);
return(0);
}
}
}
}

total=OrdersTotal();
for(cnt=0;cnt<OrdersTotal();cnt++)
{
cg = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_BUY && OrderSymbol()==Symbol())
{
if(OrderType()==OP_SELL)
{
//if ((OrderOpenTime() - (CurTime() >= 300))|| (AccountProfit() >2))//1 Day//
if((TimeCurrent() - OrderOpenTime() >= 300) || (AccountProfit() >2))
{
cg = OrderClose(OrderTicket(),OrderLots(),Bid,0,Violet);
return(0);
}
}
}
}
return(0);
}

 

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 智能交易系统 botoupi EA
上一篇:
下一篇:
分享到:更多 ()