查看: 1445|回复: 11
|
想学学写 EA,请教大大们!!!
[复制链接]
|
|
发表于 31-5-2009 12:16 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 31-5-2009 10:54 PM
|
显示全部楼层
Thanks, and best of all, it's in chinese!!! |
|
|
|
|
|
|
|
发表于 1-6-2009 01:39 PM
|
显示全部楼层
|
|
|
|
|
|
|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2-6-2009 11:51 AM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 2-6-2009 01:56 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 2-6-2009 02:55 PM
|
显示全部楼层
你是不是想要,当每一支蜡烛开始时就进场?
可以用
if(Volume[0]==1)
OrderSend(Symbol(), OP_SELL, 1, Bid,2, SL, TP, comment, 12340, 0)
Symbol()跟随chart 的 currency
op_sell 是卖
1 是 lot
bid,卖价
2 是 slippage
SL, Tp, comment 你应该懂
12340 magic number
0 ,你选color的
一来放
extern int SL= 1000;
extern int TP= 1000;
总之是parameter,酱子你test时才可以乱乱改
如果放号码 (constant) 的话就是 static的了。 |
|
|
|
|
|
|
|
![](static/image/common/ico_lz.png)
楼主 |
发表于 4-6-2009 01:45 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 4-6-2009 02:07 PM
|
显示全部楼层
int start()
extern int SL         =999 ;
extern int TP         =999 ;
extern double lot   =1.1  ;
if(Volume[0]==1)
OrderSend(Symbol(), OP_SELL, lot, Bid,2, SL, TP, comment, 12340, 0);
return(0);
最简单是酱 ![](static/image/smiley/default/icon_redface.gif) |
|
|
|
|
|
|
|
![](static/image/common/ico_lz.png)
楼主 |
发表于 4-6-2009 11:27 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 5-6-2009 12:01 AM
|
显示全部楼层
原帖由 smusic88 于 4-6-2009 11:27 PM 发表 ![](http://cforum5.cari.com.my/images/common/back.gif)
我还是不能自动买入!!!
我每次新的蜡蛀相都不能自动进,完全没有反应!!!
而且comment 他说我 error!!!
我改了以下没有error 了,还是不能!!!
ext ...
extern int SL =30 ;
extern int TP =30 ;
extern double lot =1 ;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if(Volume[0]==1)
OrderSend(Symbol(), OP_SELL, lot, Bid,10, Bid+(SL*Point), Bid-(TP*Point),"my1ea", 12340, 0,Red);
//----
return(0);
}
//+------------------------------------------------------------------+
//参考macdsample :OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"macd sample",16384,0,Red);
//错误:ERR_STRING_PARAMETER_EXPECTED 4062 字行预计参量。 |
|
|
|
|
|
|
|
发表于 5-6-2009 01:56 PM
|
显示全部楼层
真是不好意识啊,忘了要 +- *Point
不要怪我,我每次都是直接拿block放进去的所以忘了![](static/image/smiley/default/icon_redface.gif) |
|
|
|
|
|
|
| |
本周最热论坛帖子
|