评分: Empty Star Empty Star Empty Star Empty Star Empty Star
Anyone know a clever way to generate a message when an order closes by SL
stevetrade

从……加入成为会员 Oct 28, 2009  1162个发言 Steve Boardman (stevetrade) Apr 12 2012 at 13:17
I'm in the process of writing a new EA that has a trailing stop and I'd like to generate a message when the stop loss is hit. However as the tick that would be used to generate a message would also close the position I'm not sure of the best way to do this or even if it's possible. If anyone has got any smart ideas then I'd love to hear them.
Best regards Steve

11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
compuforexpamm

从……加入成为会员 Aug 20, 2009  202个发言 kennyhubbard (compuforexpamm) Apr 12 2012 at 15:19
Steve,

You could store the trades in 2 arrays, one for 'previous tick' trades and one for current trades. This will tell you that your order has just closed.

You could then examine the closed trade and compare the closeprice with your stoploss. If the closeprice is equal to, or worse than your stoploss then it can be assumed that the trade was closed by your stoploss.

I reckon this method might not be totally infallible but I would say it should be 99% accurate.

Regards

Kenny

Wealth Creation Through Technology
stevetrade

从……加入成为会员 Oct 28, 2009  1162个发言 Steve Boardman (stevetrade) Apr 12 2012 at 15:30
Thanks Kenny that's spot on. Couldn't see the wood for the trees there.
Best regards Steve

11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
请登入账户再评论。
SNB Chairman Jordan Speech (2 min)
Flash: a USD Sell off likely and positive for...(19 min ago)
EURUSD 1.29328 GBPUSD 1.5089
USDJPY 102.812 USDCAD 1.02825
工具 社区 评论 平台 公司 支持
经济日历 社区 交易商 Widget 小工具 关于 常见问题
Forex Market 系统 专业人士 功能 部落格 帮助
Forex Volatility Most Popular Systems 信号提供者 API 推特 联系我们
Forex Correlation 策略 VPS Services 移动版 Facebook 错误回报!
外汇经纪商点差 比赛 EA Programming 翻译    
Forex Broker Quotes Forex Charts PAMM Brokers RSS    
Forex Broker Swaps 社区展望 Rebate Programs      
串流外汇新闻   Trading Platforms      
Forex Broker Volume          
COT Data New          

网站地图  |   合作条款  |   隐私权政策
©2012 Myfxbook Ltd. All Rights Reserved.
HIGH RISK WARNING: Foreign exchange trading carries a high level of risk that may not be suitable for all investors. Leverage creates additional risk and loss exposure. Before you decide to trade foreign exchange, carefully consider your investment objectives, experience level, and risk tolerance. You could lose some or all of your initial investment; do not invest money that you cannot afford to lose. Educate yourself on the risks associated with foreign exchange trading, and seek advice from an independent financial or tax advisor if you have any questions. Any data and information is provided 'as is' solely for informational purposes, and is not intended for trading purposes or advice.