• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 1:38am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 1:38am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Help adding sound & email alert 8 replies

Need Trade Open & Close Sound Alert Indicator 0 replies

Order Open/Close Mobile or Email Alert Indicator - Solved 0 replies

Need help with email and sound alert... 3 replies

sound and email indicator alerts - help! 12 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: Help improve this open/close Order Alerts (Email/Sound/Alert) indicator
Exit Attachments

Help improve this open/close Order Alerts (Email/Sound/Alert) indicator

  • Post #1
  • Quote
  • First Post: Edited at 8:23am May 8, 2012 8:08am | Edited at 8:23am
  •  Liquid007
  • | Joined Apr 2012 | Status: Member | 20 Posts
Hi,

I have made an indicator (see attachment) based on a bunch of current indicators to Alert/Email/Sound when orders are opened and closed.
When an order is closed the Alert/Email will detail the ticket, pair, lots, profit/loss, commission, ect. This works without problems.

When an order is opened the Alert/Email will detail the ticket, pair, Lots, ect... This works fine when placing a market order.

But when a pending orders get filled the Alert/Email info (ticket, pair, Lots, ect...) will not state the info from the filled order but instead the info of the last added pending order, one that is not filled yet.

Can somebody help me, or give tips to make this work so the right info gets send by Alert/Email when a pending order is executed. I'm not a (good) coder, in fact I do my coding with a copy/paste strategy ;-)
Thanks so much for the help.
Attached Files
File Type: mq4 Order Alerts.mq4   4 KB | 698 downloads
File Type: rar sounds.rar   250 KB | 588 downloads
  • Post #2
  • Quote
  • May 15, 2012 1:55pm May 15, 2012 1:55pm
  •  Liquid007
  • | Joined Apr 2012 | Status: Member | 20 Posts
Anybody?
 
 
  • Post #3
  • Quote
  • May 15, 2012 3:59pm May 15, 2012 3:59pm
  •  cyber1
  • Joined Jan 2011 | Status: Member | 1,299 Posts
Quoting Liquid007
Disliked
Anybody?
Ignored
Just at first glance you have this line:

if ((OrderType() == OP_BUY) || (OrderType() == OP_SELL))
number++;

Try commenting out or add:
OP_BUYSTOP
OP_BUYLIMIT
OP_SELLSTOP
OP_SELLLIMIT
 
 
  • Post #4
  • Quote
  • May 15, 2012 5:26pm May 15, 2012 5:26pm
  •  Liquid007
  • | Joined Apr 2012 | Status: Member | 20 Posts
Thanks for your help.
I just tried to add them but then I receive the Alert directly when placing the pending order and when the order gets eventually executed/filled it mixes the info up again.
When closing the order the information is right because the following lines in the code:
----
total = OrdersHistoryTotal();
OrderSelect(total -1,SELECT_BY_POS,MODE_HISTORY);
----
It takes/selects the information from the last closed order out of the order history.

For for the opening I do not know what code to use to select the last executed/filled active order.
 
 
  • Post #5
  • Quote
  • May 15, 2012 5:42pm May 15, 2012 5:42pm
  •  cyber1
  • Joined Jan 2011 | Status: Member | 1,299 Posts
Quoting Liquid007
Disliked
[font=Verdana]Thanks for your help.
I just tried to add them but then I receive the Alert directly when placing the pending order and when the order gets eventually executed/filled it mixes the info up again.
When closing the order the information is right because the following lines in the code:
----
total = OrdersHistoryTotal();
OrderSelect(total -1,SELECT_BY_POS,MODE_HISTORY);
----
It takes/selects the information from the last closed order out of the order history.

For the opening I do not know what code to use to...
Ignored
I'm not aware of any way to alert when a pending order gets filled directly.

I'm going to post some code and maybe you can find a way to make it work for your situation.

Inserted Code
for(int i=0;i<OrdersTotal();i++){
 if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
 if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber){
 BarsCnt=iBarShift(NULL,0,OrderOpenTime());
 openorders+=1;
 if(OrderType()==OP_BUY) buys++;
 if(OrderType()==OP_SELL) sells++;
 }  
}

Use Symbol() and OrderMagicNumber() on that Symbol to see when the last order was opened along with iBarShift().
 
 
  • Post #6
  • Quote
  • May 16, 2012 1:39pm May 16, 2012 1:39pm
  •  Liquid007
  • | Joined Apr 2012 | Status: Member | 20 Posts
I'm going to study a bit more coding to do this successfully...
Thanks again for your help/tips.
 
 
  • Post #7
  • Quote
  • Last Post: Jan 21, 2016 9:22am Jan 21, 2016 9:22am
  •  rotu
  • | Joined Sep 2015 | Status: Member | 4 Posts
Quoting Liquid007
Disliked
I'm going to study a bit more coding to do this successfully... Thanks again for your help/tips.
Ignored
Hey,

have you finished coding the indicator and solved the problem with the pending orders? I am asking because I am searching for an indicator that alerts you when a pending order has been triggered and I can't seem to find one.

All the best.
 
 
  • Platform Tech
  • /
  • Help improve this open/close Order Alerts (Email/Sound/Alert) indicator
  • Reply to Thread
0 traders viewing now
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022