|
|
发表于 12-12-2008 02:55 AM
|
显示全部楼层
原帖由 yast77 于 7-12-2008 11:16 PM 发表 
大家好,最近WHA928有和我联络,他已经告诉我他的新策略了,我也帮他写了EA,刚刚写完,要在下个礼拜开始试。这个EA Backtest是得不到真确的Result的,因为是MTF,所以需要Forward Test来看它的Performance。可以在此 ...
要如何安装??? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 12-12-2008 07:53 AM
|
显示全部楼层
原帖由 callmedante 于 12-12-2008 12:26 AM 发表 
回复 81# mancai 的帖子 我從頭看了一遍你po的帖子,還是有些問題想請你指點一下
1:一個icustom只能指定一個該indicator?的extern variable?
2:如果想要指定第2個variable就要設定其他的變數?
3:不需要include什麼東西,只需要把indicator丟在同一個資料夾
然後輸入indicator的名字就好?MQL4會自動幫你include?
4:如果indicator的名字一樣,那麼MQL4辨認他們的方法
就是靠參數的設置?
5:我要如何知道我現在要關掉的trade是那一單?比方說,我分別開了兩個EUR/USD的CHART
一個是15分鐘的﹔另外一個則是30分鐘的。我分別在這兩個CHART下了一單
我要如何讓我的EA知道,我要關閉的是那一筆交易呢?
我目前想寫的EA不包含入場條件,只會自動幫忙設置止損
以及當達到出場條件時會自動幫你出場而已
何時入場,買或賣都必須由自己決定
寫完了會放出來,希望可以幫到一些人
如果你的parameter有不一样,应该给它命名一个extern variable名字
为了方便我refer,我会在sell/buy都放不一样的variable名字
那些可以改变parameter input的indicator,如果EA用到不同参数的setting,我都只refer同一个indicator,如果没有parameter input的,我会改indicator。
最后一个应该可以用magic number来分别不同的chart。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 12-12-2008 07:54 AM
|
显示全部楼层
原帖由 callmedante 于 12-12-2008 12:26 AM 发表 
我目前想寫的EA不包含入場條件,只會自動幫忙設置止損
以及當達到出場條件時會自動幫你出場而已
何時入場,買或賣都必須由自己決定
寫完了會放出來,希望可以幫到一些人
为何不写自动入场?? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 12-12-2008 08:01 AM
|
显示全部楼层
原帖由 占士邦 于 12-12-2008 02:55 AM 发表 
要如何安装???
http://cforum2.cari.com.my/viewthread.php?tid=1249423&extra=&page=1
看这里。。。 |
|
|
|
|
|
|
|
|
|
|
发表于 12-12-2008 06:53 PM
|
显示全部楼层
原帖由 mancai 于 12-12-2008 07:54 AM 发表 
为何不写自动入场??
因為我覺得入場條件比出場條件難寫得多,最關鍵的因素是該系統的入場條件我還沒有掌握
入場條件我應該會等我有一定的實戰經驗後再說
我還有一個問題,若是manual下單,該如何拿到那一單的magic number?謝謝你的指點
請問你是否知道那裡有一本比較全面的,關於mql4的教科書?
[ 本帖最后由 callmedante 于 13-12-2008 06:36 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 8-1-2009 01:42 AM
|
显示全部楼层
原帖由 mancai 于 7-1-2009 10:11 PM 发表 
try用Ask而不要用Bid來寫寫看,EMA50,最少一個bar后若再度碰到MA50就close order對嗎?
我試下寫來看看。
不好意思。。。ASK 和 BID 有些什么分别吗?。。。
EMA50,最少一個bar后若再度碰到 MA50 就 close order。。。原则上是这样。。。一直循环。。。用手的话就要动作非常的快了。。。用 EA 来玩应该会更好呱。。。
会先写一个流程图放上来。。。没有问题的话就可以研究要如何动手开始写了。。。
 |
|
|
|
|
|
|
|
|
|
|
发表于 13-12-2008 06:35 PM
|
显示全部楼层
原帖由 callmedante 于 12-12-2008 06:53 PM 发表 
因為我覺得入場條件比出場條件難寫得多,最關鍵的因素是該系統的入場條件我還沒有掌握
入場條件我應該會等我有一定的實戰經驗後再說
我還有一個問題,若是manual下單,該如何拿到那一單的magic number?謝謝你的 ...
這個網站的教程不錯 http://www.metatrader.info/node/34 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 14-12-2008 01:34 AM
|
显示全部楼层
你知道mouteki method吗?
我想用trendmeleaveme EA来做trend line EA,但它需要3条线,很麻烦
你觉得能弄成一条线, name buy or sell at trend/horizontal line,然后bar越过他就开始send order吗? |
|
|
|
|
|
|
|
|
|
|
发表于 16-12-2008 05:59 PM
|
显示全部楼层
你還真快手,我今天才剛研究它的code。的確是只需一條線就行了,最多能用兩條線。
不過我還沒用它,因為忙著追tvb戲 |
|
|
|
|
|
|
|
|
|
|
发表于 14-12-2008 08:29 PM
|
显示全部楼层
原帖由 mancai 于 14-12-2008 07:21 PM 发表 
那些EA我backtest 过,成绩不是很好,就好像mouteki indicator和demark mouteki,它们找wave的最高和最低点不是很准下。
我不是要EA自己找那两个点,你看trendmeleaveme EA,他需要manual 画3条线,把那三条线改 ...
意思是說你要簡化trendmeleaveme EA,改成只畫一條線就能自動place order?
可是還是要自己動手畫線。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 15-12-2008 12:23 AM
|
显示全部楼层
原帖由 my_life_my_way 于 14-12-2008 08:29 PM 发表 
意思是說你要簡化trendmeleaveme EA,改成只畫一條線就能自動place order?
可是還是要自己動手畫線。
對,只要一條自己繣的buy or sell綫就好了
[ 本帖最后由 mancai 于 15-12-2008 12:25 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 15-12-2008 12:40 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 15-12-2008 02:52 AM
|
显示全部楼层
原帖由 mancai 于 15-12-2008 12:23 AM 发表 
對,只要一條自己繣的buy or sell綫就好了
這得要花時間研究一下,它的code有點復雜。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 15-12-2008 07:44 AM
|
显示全部楼层
原帖由 forexStudent 于 15-12-2008 12:40 AM 发表 
请问各位大大, CYLEE的华文名是什麽呢?
你问错地方了吧?该去期货的帖问。
原帖由 my_life_my_way 于 15-12-2008 02:52 AM 发表 
這得要花時間研究一下,它的code有點復雜。
谢谢~!! |
|
|
|
|
|
|
|
|
|
|
发表于 8-1-2009 10:38 PM
|
显示全部楼层
// 1st line buffer
#property copyright "Copyright ?2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int init() // expert initialization function
{
Print("check init");
return(0);
}
int deinit() // expert deinitialization function
{
Print("check deinit");
return(0);
}
int start() // expert start function
{
Print("check start");
double EMA20_value = iMA(NULL,1,20,0,1,0,0);
double EMA50_value = iMA(NULL,1,50,0,1,0,0);
double EMA250_value = iMA(NULL,1,250,0,1,0,0);
Print("check 50 ema value - ", EMA50_value);
Print("check Bid value - ", Bid);
int ticket;
if(Bid < EMA20_value)
{
Print("bid equal to ema");
ticket=OrderSend(Symbol(),OP_SELL,1,Bid,3,Bid+15*Point,0,"My order #2",16384,0,Green);
if(ticket<0)
{
Print("OrderSend failed with error # ",GetLastError());
return(0);
}
}else{
Print("bid not equal to ema");
}
return(0);
} |
|
|
|
|
|
|
|
|
|
|
发表于 16-1-2009 12:32 AM
|
显示全部楼层
原帖由 mancai 于 15-1-2009 11:11 PM 发表 
Project A - Scalping every 30M
- This is high risk strategy.
- Basically the setting are as below :
o Strategy : Straddle on open price for every 30M candle stick.
o Time range : 4pm ~ 1am
o Pa ...
好长的英文。。。要搞懂也要花一段时间呱。。。
我写的 EA 。。。基本上是要自己去调 2 条 EMA 。。。EA 就会自动帮你买了。。。卖的还没有写好。。。
要买的话。。。把 EMA_Buy_Sell 设定在 EMA_Take_Action 的下面。。。EA 就知道你要买。。。
然后再看情况调整 EMA_Take_Action 的数值。。。把支撑点找出来就可以了。。。用 M30 的效果应该是最好的。。。几个小时调一次就可以了。。。不用那么累罗。。。

// Buy_Order.mq4
#property copyright "Copyright ?2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern int EMA_Frame = 30;
extern int EMA_Take_Action = 40;
extern int EMA_Buy_Sell = 50;
extern double StopLoss = 25;
extern double SetNewStopLoss = 0.0025;
extern double OrderLot = 1.0;
string BidPrevious = "Unknown";
string BidLatest = "Unknown";
int init() // expert initialization function
{
Print("init" ;
return(0);
}
int deinit() // expert deinitialization function
{
Print("deinit" ;
return(0);
}
int OrdersCount()
{
int totalOrders = OrdersTotal();
int count =0;
for(int cnt = 0 ; cnt < totalOrders ; cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol())
count++;
}
return (count);
}
int start() // expert start function
{
int totalOrders;
Print("------------- start -------------" ;
totalOrders = OrdersCount();
Print("orders ", totalOrders);
double EMA_Take_Action_Value = iMA(NULL,EMA_Frame,EMA_Take_Action,0,1,0,0);
double EMA_Buy_Sell_Value = iMA(NULL,EMA_Frame,EMA_Buy_Sell,0,1,0,0);
Print("EMA frame ", EMA_Frame);
Print("EMA take action ", EMA_Take_Action);
Print("EMA buy sell ", EMA_Buy_Sell);
Print("Stoploss ", StopLoss);
Print("Set new stop loss ", SetNewStopLoss);
Print("Lots ", OrderLot);
Print("EMA take action value ", EMA_Take_Action_Value);
Print("EMA buy sell value ", EMA_Buy_Sell_Value);
Print("Bid value ", Bid);
if(Bid - EMA_Buy_Sell_Value >= 0 && Bid - EMA_Buy_Sell_Value <= 0.0005)
{
PlaySound("003.wav" ;
}else{
if(Bid - EMA_Buy_Sell_Value >= -0.0005 && Bid - EMA_Buy_Sell_Value <= -0.0001)
{
PlaySound("004.wav" ;
}else{
if(Bid - EMA_Take_Action_Value >= 0 && Bid - EMA_Take_Action_Value <= 0.0005)
{
PlaySound("news.wav" ;
}else{
if(Bid - EMA_Take_Action_Value >= -0.0005 && Bid - EMA_Take_Action_Value <= -0.0001)
{
PlaySound("stops.wav" ;
}
}
}
}
double BidActionDiffrence = Bid - EMA_Take_Action_Value;
Print("************ Bid take action diffrence ************ ", BidActionDiffrence);
if(BidPrevious == "Unknown"
{
Print("Bid Previous 1-1 ", BidPrevious);
Print("Bid Latest 1-1 ", BidLatest);
if(BidActionDiffrence >= 0){
BidLatest = "Upper";
}else{
BidLatest = "Lower";
}
BidPrevious = "Known";
Print("Bid Previous 1-2 ", BidPrevious);
}else{
Print("Bid Latest 2-1 ", BidLatest);
Print("Bid Previous 2-1 ", BidPrevious);
BidPrevious = BidLatest;
Print("Bid Previous 2-2 ", BidPrevious);
if(BidActionDiffrence >= 0){
BidLatest = "Upper";
}else{
BidLatest = "Lower";
}
Print("Bid Latest 2-2 ", BidLatest);
}
if(EMA_Take_Action_Value - EMA_Buy_Sell_Value > 0) // decide buy or sell
{
int ticketBuy;
if(Bid - EMA_Take_Action_Value >= 0.0001 && Bid - EMA_Take_Action_Value <= 0.0005 && totalOrders < 1)
{
if(BidPrevious == "Lower"
{
ticketBuy=OrderSend(Symbol(),OP_BUY,OrderLot,Ask,3,Ask-StopLoss*Point,0,"My order #2",16384,0,Green);
PlaySound("ok.wav" ;
if(ticketBuy<0)
{
Print("OrderSend failed with error # ",GetLastError());
return(0);
}
}
}
}
if(totalOrders > 0) // set new stop loss
{
double PriceDiffrence = Bid - OrderOpenPrice();
Print("Order Ticket ", OrderTicket());
Print("Order Open Price ", OrderOpenPrice());
Print("Order stop loss ", OrderStopLoss());
Print("============ Bid Order Price Diffrence ============ ", PriceDiffrence);
if(Bid - OrderOpenPrice()>= SetNewStopLoss)
{
double StopLossNewValue = EMA_Take_Action_Value - 0.0005;
Print("EMA stoploss ", StopLossNewValue);
if(StopLossNewValue - OrderStopLoss() >= 0.0005)
{
OrderModify(OrderTicket(),OrderOpenPrice(),StopLossNewValue,OrderTakeProfit(),0,Blue);
}
}
return(0);
}
return(0);
} |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 16-12-2008 01:41 PM
|
显示全部楼层
EA to open positions at trend lines..
http://www.forexfactory.com/showthread.php?t=36487
找到这个了,还没try,感觉好像很不错。
trendmeleaveme EA 原来只须画一条BuyStop or SellStop line,但唯一不爽的是他会在BuyStop_StepLower or SellStop_StepUpper后开几十个pending order,一直开一直cancel直到到BuyStop or SellStop。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 16-12-2008 07:30 PM
|
显示全部楼层
原帖由 Boon_head 于 16-12-2008 06:58 PM 发表 
可以msn send吗??
http://vspace.cc/file/X3AKZC5RJH4MTRCI.html
那個不allow ex4 upload,那EA你不需要改名,只需要把下面的condition paste進description就可以了
Action=Buy Trigger=0 TP=100 SL=20 TS=20 BE=10 Lots= 0.1 |
|
|
|
|
|
|
|
|
|
|
发表于 16-12-2008 06:30 PM
|
显示全部楼层
mancai...你有MT4 MACD两条线的system吗?? |
|
|
|
|
|
|
|
|
|
|
发表于 16-12-2008 07:14 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|