[MT4-EA]日挣百点,100 pips a day
信不信由你
我?
我看明白代码再告诉你哈//+------------------------------------------------------------------+
//| 100 pips a day.mq4 |
//| Copyright 2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern int timeframe = 5;
extern double stopLoss = 1000;
extern double lTakeProfit = 1000;
extern double sTakeProfit = 1000;
extern double lTrailingStop = 100;
extern double sTrailingStop = 100;
extern color clOpenBuy = Blue;
extern color clCloseBuy = Aqua;
extern color clOpenSell = Red;
extern color clCloseSell = Violet;
extern color clModiBuy = Blue;
extern color clModiSell = Red;
extern string Name_Expert = "100pips";
extern int Slippage = 2;
extern bool UseSound = true;
extern string NameFileSound = "shotgun.wav";
extern double Lots = 0.1;
extern int slippage=3;
double lshist;
double lshistb4,lshistb4b4;
int init(){return(0);}
int deinit(){return(0);}
int start(){
if(Bars<100) {Print("bars less than 100");return(0);}
if(lTakeProfit<10){Print("TakeProfit less than 10");return(0);}
if(sTakeProfit<10){Print("TakeProfit less than 10");return(0);}
if(timeframe==0) {timeframe=Period();}
double diClose0=iClose(Symbol(),timeframe,0);
double diMA1=iMA(Symbol(),timeframe,7,0,MODE_SMA,PRICE_OPEN,0);
double diClose2=iClose(Symbol(),timeframe,0);
double diMA3=iMA(Symbol(),timeframe,6,0,MODE_SMA,PRICE_OPEN,0);
lshist=iCustom(NULL,0,"lswpr_angleexp",0,1);
lshistb4=iCustom(NULL,0,"lswpr_angleexp",0,2);
lshistb4b4=iCustom(NULL,0,"lswpr_angleexp",0,3);
CloseAllOrders();
if(AccountFreeMargin()<(1000*Lots)){
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0); }
if(!ExistPositions()) {
// diClose0=iClose(Symbol(),timeframe,0);
// diMA1=iMA(Symbol(),timeframe,7,0,MODE_SMA,PRICE_OPEN,0);
// diClose2=iClose(Symbol(),timeframe,0);
// diMA3=iMA(Symbol(),timeframe,6,0,MODE_SMA,PRICE_OPEN,0);
// lshist=iCustom(NULL,0,"lswpr_angleexp",0,0);
// lshistb4=iCustom(NULL,0,"lswpr_angleexp",0,1);
// if((diClose0lshistb4)) {
if((lshist> lshistb4)) {
OpenBuy();
return(0); }
// if ((diClose2>diMA3&& lshisttrailingStop*Point) {
if(OrderStopLoss()trailingStop*Point) {
if(OrderStopLoss()>Ask+trailingStop*Point || OrderStopLoss()==0) {
ModifyStopLoss(Ask+trailingStop*Point);}}}}}}
void ModifyStopLoss(double ldStopLoss) {
bool fm;
fm = OrderModify(OrderTicket(),OrderOpenPrice(),ldStopLoss,OrderTakeProfit(),0,0);
if (fm && UseSound) PlaySound(NameFileSound);
}
void OpenBuy() {
double ldLot, ldStop, ldTake;
string lsComm;
ldLot = GetSizeLot();
ldStop = Ask-Point*stopLoss;
ldTake = NormalizeDouble(GetTakeProfitBuy(),Digits);
lsComm = GetCommentForOrder();
OrderSend(Symbol(),OP_BUY,ldLot,NormalizeDouble(Ask,Digits),Slippage,ldStop,ldTake,lsComm,0,0,clOpenBuy);
if (UseSound) PlaySound(NameFileSound); }
void OpenSell() {
double ldLot, ldStop, ldTake;
string lsComm;
ldLot = GetSizeLot();
ldStop = Bid+Point*stopLoss;
ldTake = NormalizeDouble(GetTakeProfitSell(),Digits);
lsComm = GetCommentForOrder();
OrderSend(Symbol(),OP_SELL,ldLot,NormalizeDouble(Bid,Digits),Slippage,ldStop,ldTake,lsComm,0,0,clOpenSell);
if (UseSound) PlaySound(NameFileSound); }
string GetCommentForOrder() { return(Name_Expert); }
double GetSizeLot() { return(Lots); }
double GetTakeProfitBuy() { return(Ask+lTakeProfit*Point); }
double GetTakeProfitSell() { return(Bid-sTakeProfit*Point); }
void CloseAllOrders()
{
for( int cnt=OrdersTotal();cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()==Symbol() )//&& OrderMagicNumber()==MagicNumber)
{
if (OrderType()==OP_BUY) {
if ((lshist< lshistb4 && lshistb4lshistb4 && lshistb4>lshistb4b4)) {
{ OrderClose(OrderTicket(),OrderLots(),Ask,slippage,Yellow); }}
return(0);
}
}
}
发表于:2014-01-04 08:11只看该作者
2楼
要求好高
韬客社区www.talkfx.co
3楼
关注哈
发表于:2014-01-06 05:02只看该作者
4楼
楼主头像不错
韬客社区www.talkfx.co
发表于:2014-12-18 07:06只看该作者
5楼
楼主头像不错:宝:
韬客社区www.talkfx.co
发表于:2015-01-06 03:24只看该作者
6楼
不错的指标 ~谢谢楼主~
韬客社区www.talkfx.co
发表于:2015-01-11 12:46只看该作者
7楼
用过,还行。
韬客社区www.talkfx.co
发表于:2015-01-11 13:31只看该作者
8楼
无法正确编译
发表于:2015-04-16 06:33只看该作者
9楼
有谁会用吗
韬客社区www.talkfx.co
发表于:2015-04-28 14:03只看该作者
10楼
不知道怎么使用啊
韬客社区www.talkfx.co
发表于:2015-05-14 06:21只看该作者
11楼
lswpr_angleexp 楼主没有这个指标。。这个EA没法工作的
韬客社区www.talkfx.co
发表于:2015-06-07 09:21只看该作者
12楼
谢谢分享!!
韬客社区www.talkfx.co
发表于:2015-06-07 09:22只看该作者
13楼
谢谢分享!!
韬客社区www.talkfx.co
发表于:2015-06-25 04:30只看该作者
14楼
谢谢分享~!!!
韬客社区www.talkfx.co
发表于:2015-06-30 02:52只看该作者
15楼
HONGCHUN 发表于 2015-6-25 12:30
谢谢分享~!!!
发表于:2015-07-06 05:42只看该作者
16楼
啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊
韬客社区www.talkfx.co
发表于:2016-02-18 08:27只看该作者
18楼
看不懂
韬客社区www.talkfx.co
发表于:2016-02-18 12:00只看该作者
19楼
谢谢分享
韬客社区www.talkfx.co
发表于:2016-02-18 12:10只看该作者
20楼
不太可能
韬客社区www.talkfx.co