请教一个MT4的问题,卖单的时候130错误,止损现货止盈止损怎么设置多少才算合适

帐号:密码:下次自动登录{url:/nForum/slist.json?uid=guest&root=list-section}{url:/nForum/nlist.json?uid=guest&root=list-section}
贴数:2&分页:飞哥发信人: gucst (飞哥), 信区: ProgramTrading
标&&题: Re: 请教一个MT4的问题,卖单的时候130错误,止损止盈多少才算
发信站: 水木社区 (Wed Sep 26 23:07:28 2012), 站内 && 两个问题,滑点3太小,我的设置是13,止赢止损间隔太小,很多平台有间距要求的,起码也要100个Point以上吧
【 在 royguo1988 (MrROY) 的大作中提到: 】
: 我是这么写的:
: OrderSend(Symbol(),OP_SELL,one_volume,Bid,3,Bid+25*Point,Bid-25*Point,"Order Sell",2222,0,Red);
: Bid+25*Point算是止损,为何要报130错误,即止损止盈离 "too close to the market"
: ...................
名利脚下踩,情义两肩挑! &&&& ※ 来源:·水木社区 newsmth.net·[FROM: 218.60.139.*]
飞哥发信人: gucst (飞哥), 信区: ProgramTrading
标&&题: Re: 请教一个MT4的问题,卖单的时候130错误,止损止盈多少才算
发信站: 水木社区 (Wed Sep 26 23:22:35 2012), 站内 && 你设置3个point滑点,那基本上,开仓八成都会失败,而这一失败,只会在实战中体现,而模拟和回测,都不会出现,ecn平台,最少要10个point以上,mm平台则要更高一些
【 在 royguo1988 (MrROY) 的大作中提到: 】
: 原来如此,我按照飞哥的方式是可以简单实现的,应该是MT4内部做了操作
名利脚下踩,情义两肩挑! &&&& ※ 来源:·水木社区 newsmth.net·[FROM: 218.60.139.*]
文章数:2&分页:
抽奖到手软!将狂欢进行到底!官方微信公共号:onefx8
查看: 62220|回复: 855
止损、止盈、移动止损、按比例分批离场工具(完结篇)
本帖最后由 网毒 于
19:31 编辑
自己写的一个小工具,也许有错误,如果使用中有错误,麻烦大家将错误汇报到这个帖子里面,以方便改掉错误。谢谢
功能简要描述:
1、自动添加止损止盈;
2、在盈利点数大于移动止损点数以后,将激活移动止损;
3、可以在从入场价到止盈价之间,按你设置的次数,按比例离场。
& &&&比如你设置的三次,那么在从入场价到止盈价目标三分之一的时候,平掉三分之一的仓位;到达三分之二的时候,又平掉三分之一的仓位;剩下的三分之一,要么触及移动止损,要么到达止盈位置平仓。
必须设置了止盈价,才可以使用分批逐步离场功能。
使用方法:
这是一个智能交易系统,请将程序放到MT4安装目录下面的experts目录下面,然后在MT4的导航里面,在智能交易系统分组里面找出来即可。
完成任务,最后一次更新。
更新内容:
1、改了一些错误,测试中没有再发现新的错误
2、添加了一个drift参数,作用是当最后一次分批出场后,将止盈点设置到更远的地方,1为1倍即不变,2为2倍
3、改名字为持仓保姆。
游客,如果您要查看本帖隐藏内容请
本帖子中包含更多资源
才可以下载或查看,没有帐号?
<p id="rate_04" onmouseover="showTip(this)" tip="赞一个!&金钱 + 15 元宝
威望 + 15 星
" class="mtn mbn">
<p id="rate_39" onmouseover="showTip(this)" tip="多谢分享&金钱 + 10 元宝
威望 + 10 星
" class="mtn mbn">
支持下载看看。
LZ检验到效果如何?
不过还是要严重支持~~
希望公布原码
严重支持,至少从国人比较缺少的共享精神来说,楼主值得称赞。
帮我写个20bar内最大值与最少值之差大于某个数值(可设定)时会报警
可以吗,谢谢
这个得看看,好啊
:yct22:yct22:yct22
看看了辛苦你了
支持下载看看
路过。学习一下
应要求,将源码附上:
//+------------------------------------------------------------------+
//|& && && && && && && &自动止损、止盈、盈利后移动止损、分批出场.mq4 |
//|& && && && && && && && && && && && &&&Copyright ?2009, 龙德而隐者 |
//|& && && && && && && && && && && && && && && && && && && && && && &|
//+------------------------------------------------------------------+
#property copyright &Copyright 2009 by 龙德而隐者&
#property link& && &&http://www.metaquotes.net/&
extern string 自动止损参数=&默认打开&;
extern bool AutoStoploss=T
extern double stoploss= 22;
extern string 自动止盈参数=&默认打开&;
extern bool AutoTakeProfit=T
extern double takeprofit=30;
extern string 盈利后移动止损=&默认打开&;
extern bool AutoTrailingStop=
extern double TrailingStop = 15;
extern string 分次离场参数=&按比例分步撤退&;
extern bool Gradually = F
extern int GraduallyNum = 3;
double OriginalL
//+------------------------------------------------------------------+
//| expert start function& && && && && && && && && && && && && && &&&|
//+------------------------------------------------------------------+
int start()
for(int cnt=0;cnt&OrdersTotal();cnt++)&&
if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
&&if(OrderSymbol()==Symbol())
& &&&double stp=OrderStopLoss();
& &&&double tpt=OrderTakeProfit();
& &&&double OpenPrice = OrderOpenPrice();
& && & if (OriginalLot == 0)
& && && &&&{
& && && &&&OriginalLot=OrderLots();
& && && &&&}& &
& &&&if(OrderType()==OP_BUY)& && &&&
& && &&&CraduallyBuy ();
& & & && &&&if (AutoStoploss && AutoTakeProfit && stp==0 && tpt==0)&&
& && && & OrderModify(OrderTicket(),OrderOpenPrice(),Ask-Point*stoploss,Ask+Point*takeprofit,0,Green);
& && &&&else
& && && & if (AutoStoploss && stp==0)& && && && && &
& && && & {
& && && && &OrderModify(OrderTicket(),OrderOpenPrice(),Ask-Point*stoploss,OrderTakeProfit(),0,Green);
& & & && && & }
& & & && && & if (AutoTakeProfit && tpt==0)& && && &
& && && & {
& && && && &OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),Ask+Point*takeprofit,0,Green);
& && && & }& &
& && && & if (AutoTrailingStop&&&& ((Bid - OpenPrice) & Point*TrailingStop))& &
& && && & {
& && && && &if((Bid-stp)&TrailingStop*Point )
& && && && &OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
& && && & }
& & & && &&&}& &
&&if(OrderType()==OP_SELL)& && && && && &
& &&&CraduallySell ();
& &&&if (AutoStoploss && AutoTakeProfit && stp==0 && tpt==0)
& && & OrderModify(OrderTicket(),OrderOpenPrice(),Bid+Point*stoploss,Bid-Point*takeprofit,0,Green);
& && &&&if (AutoStoploss && stp==0)& && &&&
& && && && &OrderModify(OrderTicket(),OrderOpenPrice(),Bid+Point*stoploss,OrderTakeProfit(),0,Green);
& && &&&if (AutoTakeProfit && tpt==0)& && && &
& && && && &OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),Bid-Point*takeprofit,0,Green);
& && &&&}&&
& && &&&if(AutoTrailingStop&&&& ((OpenPrice-Ask) & Point*TrailingStop ))& && &
& & & & & & & && & if((stp-Ask)&TrailingStop*Point)
& && && && &&&OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Green);
& & OriginalLot=0;
void CraduallyBuy ()& && && && &
&&double OpenPrice = OrderOpenPrice();
&&double lot=OrderLots();& && && &&&
&&for (int yi=1;yi&=GraduallyNyi++)
& & & && &if (NormalizeDouble((Bid - OpenPrice)/Point,0) == NormalizeDouble(TrailingStop/GraduallyNum*yi,0))
& & & && &&&{
& && &&&if&&(lot != NormalizeDouble(OriginalLot*(1-yi/GraduallyNum),2))
& && && &{
& && && &&&OrderClose(OrderTicket(),NormalizeDouble(OriginalLot/GraduallyNum,2),Bid,3,CLR_NONE);
& && && &}
& && &&&& & & && && &
& & & && &&&}
void CraduallySell ()& && && && &
&&double OpenPrice = OrderOpenPrice();
&&double lot=OrderLots();& &
&&for (int yi=1;yi&=GraduallyNyi++)
& & & && &if (NormalizeDouble((OpenPrice - Ask)/Point,0) == NormalizeDouble(TrailingStop/GraduallyNum*yi,0))
& & & && &&&{& & & && &&&
& && &&&if&&(lot != NormalizeDouble(OriginalLot*(1-yi/GraduallyNum),2))
& && && &{
& && && &&&OrderClose(OrderTicket(),NormalizeDouble(OriginalLot/GraduallyNum,2),Ask,3,CLR_NONE);
& && && &}
& && &&&& & & && && &
& & & && &&&}
谢谢了,看一看。
kan kan xian
Powered by帐号:密码:下次自动登录{url:/nForum/slist.json?uid=guest&root=list-section}{url:/nForum/nlist.json?uid=guest&root=list-section}
贴数:3&分页:高效填坑,日日新高发信人: Trade (交易), 信区: ProgramTrading
标&&题: Re: 请教一个MT4的问题,卖单的时候130错误,止损止盈多少才算合
发信站: 水木社区 (Wed Sep 26 23:04:59 2012), 站内 && 这已经是我第三次回答同一问题了
把止盈止损设为零
用ordermodify 改止盈止损 && 因为按照nfa先入先出规则
open sl tp 是分别的三个单子
必须有先后顺序 && 【 在 royguo1988 的大作中提到: 】
: 我是这么写的:
: OrderSend(Symbol(),OP_SELL,one_volume,Bid,3,Bid+25*Point,Bid-25*Point,"Order Sell",2222,0,Red);
: Bid+25*Point算是止损,为何要报130错误,即止损止盈离 "too close to the market"
: ...................
&& -- && ※ 来源:·水木社区 ·[FROM: 114.84.35.*]
高效填坑,日日新高发信人: Trade (交易), 信区: ProgramTrading
标&&题: Re: 请教一个MT4的问题,卖单的时候130错误,止损止盈多少才算
发信站: 水木社区 (Wed Sep 26 23:10:39 2012), 站内 && mt4出来的时候
nfa还没有这个规则 && 【 在 royguo1988 的大作中提到: 】
: 你说的应该能实现,但是OrderSend本身提供了止盈止损参数不可能不能用啊
&& -- && ※ 来源:·水木社区 ·[FROM: 114.84.35.*]
高效填坑,日日新高发信人: Trade (交易), 信区: ProgramTrading
标&&题: Re: 请教一个MT4的问题,卖单的时候130错误,止损止盈多少才算
发信站: 水木社区 (Wed Sep 26 23:16:03 2012), 站内 && 不是ecn 撮合成交的话,那就是另外一回事 && 【 在 royguo1988 的大作中提到: 】
: 原来如此,我按照飞哥的方式是可以简单实现的,应该是MT4内部做了操作
&& -- && ※ 来源:·水木社区 ·[FROM: 114.84.35.*]
文章数:3&分页:
抽奖到手软!将狂欢进行到底!

我要回帖

更多关于 mt4止损止盈设置 的文章

 

随机推荐