- หน้าหลัก
- ชุมชน
- การเขียนโปรแกรม
- Anyone know a clever way to generate a message when an order...
Advertisement
Edit Your Comment
Anyone know a clever way to generate a message when an order closes by SL
เป็นสมาชิกตั้งแต่ Oct 28, 2009
1409 โพสต์
Apr 12, 2012 at 13:17
เป็นสมาชิกตั้งแต่ Oct 28, 2009
1409 โพสต์
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
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.
เป็นสมาชิกตั้งแต่ Aug 20, 2009
256 โพสต์
Apr 12, 2012 at 15:19
เป็นสมาชิกตั้งแต่ Aug 20, 2009
256 โพสต์
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
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
เป็นสมาชิกตั้งแต่ Oct 28, 2009
1409 โพสต์
Apr 12, 2012 at 15:30
เป็นสมาชิกตั้งแต่ Oct 28, 2009
1409 โพสต์
Thanks Kenny that's spot on. Couldn't see the wood for the trees there.
Best regards Steve
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.

*การใช้งานเชิงพาณิชย์และสแปมจะไม่ได้รับการยอมรับ และอาจส่งผลให้บัญชีถูกยกเลิก
เคล็ดลับ: การโพสต์รูปภาพ/youtube url จะฝังลงในโพสต์ของคุณโดยอัตโนมัติ!
เคล็ดลับ: พิมพ์เครื่องหมาย @ เพื่อป้อนชื่อผู้ใช้ที่เข้าร่วมการสนทนานี้โดยอัตโนมัติ