MT人工智能之四(BB突破系统)
突破交易例子
/*[[
Name := Bollinger Breakout
Author := Lior Nabat
Lots := 1.00
Stop Loss := 50
Take Profit := 90
Trailing Stop := 50
Update on every tick:= Yes
]]*/
/*
HI,
This Expert use 3 rules:
1. Breakout of Bollinger and reversal
2. Waiting for crossing the 62 EMA
3. Enough space between the 200 SMA ( that sometimes act as support and resistance
Use only in EUR/USD and USD and CHF 15 min, not optimize yet.
gives very good results,
you can increase the lots and gain more profit.
it will be great to get feedback on my Email:
[email protected]
lior,
BTW, currently the trailing stop is not working...
*/
vars: Slippage(2);
defines: EMA(62),ShortFlag(0),LongFlag(0);
vars: sl(0),tp(0),p(0),q(0),s(0),mode(0),HighBar(0),LowBar(0),OpenBar(0),CloseBar(0),Shift(0),cnt(0);
If Bars<100 or TakeProfit<10 then Exit;
If IsIndirect(Symbol)=TRUE then Exit;
p=1.0*iATR(3,1); //p=TrailingStop*Point;BUY
q=1.0*iATR(3,1); //q=TrailingStop*Point;
s=1.0*Point;
If CurTime-LastTradeTime>60 and TotalTrades<1
then
{
if open[Shift+1]<close[Shift+1] and open[Shift]>close[Shift] then
if Close[shift+1]> iBANDS(21,2,MODE_HIGH,Shift+1) then
// Checking the breakout and the reversal
{
ShortFlag=1;
LongFlag=0;
}
if ShortFlag and bid<= iMA(EMA,MODE_EMA,shift) and (close[shift] - iMA(200,MODE_SMA,Shift) > (15*point))
then
{
SetOrder(OP_SELL,Lots,bid,Slippage,Bid+StopLoss*Point,Bid-TakeProfit*Point,Red);
Alert ("Sell Short at: ",Bid,"S/L:",Bid+StopLoss*Point,"T/P: ",Bid-TakeProfit*Point);
ShortFlag=0;
Exit;
};
// checking the cross ...
//LONG TRADES ENTRY CRITERIA
if open[Shift+1]>close[Shift+1] and open[Shift]<close[Shift] then
if Close[shift+1]<iBANDS(21,2,MODE_LOW,Shift+1) then
{
ShortFlag=0;
LongFlag=1;
}
if LongFlag and ask >= iMA(EMA,MODE_EMA,shift) and (iMA(200,MODE_SMA,Shift) - open[shift]> (15*point))
then
{
SetOrder(OP_BUY,Lots,Ask,Slippage,Ask-StopLoss*Point,Ask+TakeProfit*Point,Blue);
Alert ("Buy Long at: ",Ask,"S/L:",Ask-StopLoss*Point,"T/P: ",Ask+TakeProfit*Point);
LongFlag=0;
Exit;
};
};
if TrailingStop<5 then { print("Invalid trailing stop"); Exit; };
/* 橡钼屦屐 疣礤?铗牮?? 镱玷鲨?
茵彘腓磴 耱铒 疣犷蜞弪 麇疱?祛滂翳赅鲨?Stop Loss. */
for cnt=1 to TotalTrades
begin
/* ??潆桧磬 镱玷鲨? */
If Ord(cnt,VAL_TYPE)=OP_BUY then /* 潆桧磬 镱玷鲨 */
{
/* 耥圜嚯?镳钼屦桁 - 羼螯 腓 镳铘栩 ??铋 皲咫觇 犷朦? 麇?
箴钼屙?蝠彘腓磴 耱铒? 镳钼屦屐 Bid, 蜞?赅?镱玷鲨 BUY */
If (Bid-Ord(cnt,VAL_OPENPRICE))>(TrailingStop*Point) then
{
/* 溧, 镱玷鲨 桁邋?镳栳??犷朦? 麇?珥圜屙桢 蝠彘腓磴 耱铒?
(磬镳桁屦 30 矬黻蝾?. 蝈镥瘘 磬漕 镳钼屦栩? 祛骓?腓
镱耱噔栩?耱铒 塍鼬?麇?铐 猁?疣礤? */
If Ord(cnt,VAL_STOPLOSS)<(Bid-TrailingStop*Point) then
{
/* 戾?屐 耱铒腩耨 磬 箴钼屙?Bid-Trailing Stop */
ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE),
Bid-TrailingStop*Point,Ord(cnt,VAL_TAKEPROFIT),Red);
Exit; /* 溴腩 皲咫嚯?- 恹躅滂? */
};
};
};
/* ??觐痤蜿? 镱玷鲨? */
If Ord(cnt,VAL_TYPE)=OP_SELL then
{
/* 耥圜嚯?镳钼屦桁 - 羼螯 腓 镳铘栩 ??铋 皲咫觇 犷朦? 麇?
箴钼屙?蝠彘腓磴 耱铒? 镳钼屦屐 Ask, 蜞?赅?镱玷鲨 SELL */
If (Ord(cnt,VAL_OPENPRICE)-Ask)>(TrailingStop*Point) then
{
/* 溧, 镱玷鲨 桁邋?镳栳??犷朦? 麇?珥圜屙桢 蝠彘腓磴 耱铒?
(磬镳桁屦 30 矬黻蝾?. 蝈镥瘘 磬漕 镳钼屦栩? 祛骓?腓
镱耱噔栩?耱铒 塍鼬?麇?铐 猁?疣礤? */
If Ord(cnt,VAL_STOPLOSS)>(Ask+TrailingStop*Point) or
Ord(cnt,VAL_STOPLOSS)=0 then /* 钺玎蝈朦眍?篑腩忤?!! */
{
/* 戾?屐 耱铒腩耨 磬 箴钼屙?Ask+Trailing Stop */
ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE),
Ask+TrailingStop*Point,Ord(cnt,VAL_TAKEPROFIT),Red);
Exit;
};
};
};
end;
[此帖子已被 hilow 在 2004-9-30 12:51:45 编辑过]
发表于:2004-09-29 08:03只看该作者
2楼
***if TrailingStop<5 then { print("Invalid trailing stop"); Exit; };
/* 橡钼屦屐 疣礤?铗牮?? 镱玷鲨?
茵彘腓磴 耱铒 疣犷蜞弪 麇疱?祛滂翳赅鲨?Stop Loss. */
for cnt=1 to TotalTrades
begin
/* ??潆桧磬 镱玷鲨? */
If Ord(cnt,VAL_TYPE)=OP_BUY then /* 潆桧磬 镱玷鲨 */
{
/* 耥圜嚯?镳钼屦桁 - 羼螯 腓 镳铘栩 ??铋 皲咫觇 犷朦? 麇?
箴钼屙?蝠彘腓磴 耱铒? 镳钼屦屐 Bid, 蜞?赅?镱玷鲨 BUY */
If (Bid-Ord(cnt,VAL_OPENPRICE))>(TrailingStop*Point) then
{
/* 溧, 镱玷鲨 桁邋?镳栳??犷朦? 麇?珥圜屙桢 蝠彘腓磴 耱铒?
(磬镳桁屦 30 矬黻蝾?. 蝈镥瘘 磬漕 镳钼屦栩? 祛骓?腓
镱耱噔栩?耱铒 塍鼬?麇?铐 猁?疣礤? */
If Ord(cnt,VAL_STOPLOSS)<(Bid-TrailingStop*Point) then
{
/* 戾?屐 耱铒腩耨 磬 箴钼屙?Bid-Trailing Stop */
ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE),
Bid-TrailingStop*Point,Ord(cnt,VAL_TAKEPROFIT),Red);
Exit; /* 溴腩 皲咫嚯?- 恹躅滂? */
};
};
};
/* ??觐痤蜿? 镱玷鲨? */
If Ord(cnt,VAL_TYPE)=OP_SELL then
{
/* 耥圜嚯?镳钼屦桁 - 羼螯 腓 镳铘栩 ??铋 皲咫觇 犷朦? 麇?
箴钼屙?蝠彘腓磴 耱铒? 镳钼屦屐 Ask, 蜞?赅?镱玷鲨 SELL */
If (Ord(cnt,VAL_OPENPRICE)-Ask)>(TrailingStop*Point) then
{
/* 溧, 镱玷鲨 桁邋?镳栳??犷朦? 麇?珥圜屙桢 蝠彘腓磴 耱铒?
(磬镳桁屦 30 矬黻蝾?. 蝈镥瘘 磬漕 镳钼屦栩? 祛骓?腓
镱耱噔栩?耱铒 塍鼬?麇?铐 猁?疣礤? */
If Ord(cnt,VAL_STOPLOSS)>(Ask+TrailingStop*Point) or
Ord(cnt,VAL_STOPLOSS)=0 then /* 钺玎蝈朦眍?篑腩忤?!! */
{
/* 戾?屐 耱铒腩耨 磬 箴钼屙?Ask+Trailing Stop */
ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE),
Ask+TrailingStop*Point,Ord(cnt,VAL_TAKEPROFIT),Red);
Exit;
};
};
};
end; 9***
[em19]
[em19] [em19] [em58]
[em19] [em19] [em58]
发表于:2004-10-09 00:46只看该作者
3楼
你发的这些系统我也有,一共有几十个,都试过了,不赔的只有两个,挣钱的一个也没有。
俺就是传说中的‘喊王’!
发表于:2004-10-09 08:07只看该作者
4楼
[em58]
把握当下,勇于冲击,一击不中,全身而退
发表于:2017-10-07 17:52只看该作者
6楼
顶下
韬客社区www.talkfx.co
发表于:2017-11-21 09:15只看该作者
7楼
先回复赚钱,然后才能下载。
韬客社区www.talkfx.co