Ichimoku5的自动交易程序
从老外的网站上弄到1个叫 Ichimoku5的自动交易程序,用历史数据测试成绩甚是厉害, 500刀起 0。1手的MINI,做欧元或者磅, 任何时候只下1单, 在单边的月份里可能一个月3000多收入, 在7月的震荡里还有700多收入呢。
但是在高兴了几天以后忽然发现我的测试模式有问题,似乎用“每个tick(根据所有可利用最少期限的每一个tick的分数插枝法)” 才能是比较真实的情况。而我测试的时候经常用“控制点数(根据最近最小期限内的12个控制电。。。)”的模式来测试。 听群里的高人说 Ichimoku 指标是个双刃剑,用不好会死的很惨。 希望能有高人给搞一搞,看看着东西应该怎么用。
或者有兴趣的兄弟们可以24挂模拟号帮助一起给测测吧。:lol
图贴翻了,呵呵, 奶奶的不让贴RAR附件
[ 本帖最后由 wjd76 于 2006-8-2 11:24 编辑 ]TesterGraph.gifStrategyTester.gif
2楼
小气鬼,贴个地址都不让,我粘代码没问题吧!
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Copyright 2005, bobammax |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright 2005, bobammax aka foreverold"
#property link ""
#define MAGIC 85718
extern double lStopLoss = 37;
extern double sStopLoss = 35;
extern double lTakeProfit = 80;
extern double sTakeProfit = 75;
extern double lTrailingStop = 20;
extern double sTrailingStop = 20;
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 = "Ichimoku";
extern int Slippage = 4;
extern bool UseSound = True;
extern string NameFileSound = "alert.wav";
extern double Lots = 1.00;
void deinit() {
Comment("");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start(){
if(Bars<100){
Print("bars less than 100");
return(0);
}
if(lStopLoss<10){
Print("StopLoss less than 10");
return(0);
}
if(lTakeProfit<10){
Print("TakeProfit less than 10");
return(0);
}
if(sStopLoss<10){
Print("StopLoss less than 10");
return(0);
}
if(sTakeProfit<10){
Print("TakeProfit less than 10");
return(0);
}
double diCustom0=iCustom(NULL, 240, "Ichimoku", 9, 26, 52, 0, 0);
double diCustom1=iCustom(NULL, 240, "Ichimoku", 9, 26, 52, 1, 0);
double diCustom2=iCustom(NULL, 240, "Ichimoku", 9, 26, 52, 1, 0);
double diMA3=iMA(NULL,240,34,0,MODE_EMA,PRICE_CLOSE,0);
double diCustom4=iCustom(NULL, 240, "Ichimoku", 9, 26, 52, 1, 0);
double diCustom5=iCustom(NULL, 240, "Ichimoku", 9, 26, 52, 0, 0);
if(AccountFreeMargin()<(1000*Lots)){
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
if (!ExistPositions()){
if ((diCustom0>diCustom1 && diCustom2>diMA3)){
OpenBuy();
return(0);
}
if ((diCustom4>diCustom5)){
OpenSell();
return(0);
}
}
TrailingPositionsBuy(lTrailingStop);
TrailingPositionsSell(sTrailingStop);
return (0);
}
bool ExistPositions() {
for (int i=0; itrailingStop*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,CLR_NONE);
if (fm && UseSound) PlaySound(NameFileSound);
}
void OpenBuy() {
double ldLot, ldStop, ldTake;
string lsComm;
ldLot = GetSizeLot();
ldStop = GetStopLossBuy();
ldTake = GetTakeProfitBuy();
lsComm = GetCommentForOrder();
OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenBuy);
if (UseSound) PlaySound(NameFileSound);
}
void OpenSell() {
double ldLot, ldStop, ldTake;
string lsComm;
ldLot = GetSizeLot();
ldStop = GetStopLossSell();
ldTake = GetTakeProfitSell();
lsComm = GetCommentForOrder();
OrderSend(Symbol(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenSell);
if (UseSound) PlaySound(NameFileSound);
}
string GetCommentForOrder() { return(Name_Expert); }
double GetSizeLot() { return(Lots); }
double GetStopLossBuy() { return (Bid-lStopLoss*Point);}
double GetStopLossSell() { return(Ask+sStopLoss*Point); }
double GetTakeProfitBuy() { return(Ask+lTakeProfit*Point); }
double GetTakeProfitSell() { return(Bid-sTakeProfit*Point); }
[ 本帖最后由 wjd76 于 2006-8-2 16:31 编辑 ]
韬客社区www.talkfx.co
发表于:2006-08-07 13:54只看该作者
6楼
LZ 说说怎么使用好吗
韬客社区www.talkfx.co
发表于:2006-08-14 12:34只看该作者
7楼
谢谢
韬客社区www.talkfx.co
发表于:2006-08-18 07:13只看该作者
8楼
测试没用的 最好的方法是24小时挂机测试 模拟单测试的结果 和真实操作也是会有区别的
韬客社区www.talkfx.co