Order Send From indicator

 

Hello, 

i want to code an Indicator with buttons. The buttons should do an OrderSend and Order Modify function. When ich try to test this, there comes the Error, not possible to send an OrderSend() from an indicator.

 

is this true or is this only a warning?

 

amando 

 
amando:

Hello, 

i want to code an Indicator with buttons. The buttons should do an OrderSend and Order Modify function. When ich try to test this, there comes the Error, not possible to send an OrderSend() from an indicator.

 

is this true or is this only a warning?

 

amando 

It's not possible to send orders from indicator.

Only from expert.

 

Yes, it is impossible ...

You may create an EA linked to the indicator (iCustom( ) ) ... or let the indicator code run as an EA and add the buttons you like ...

I believe, this is the only way !. 

 

You need to source code of the indicator to incorporate into an EA for automatic trading.

If you are talking about just putting a control panel on an indicator so you can trade manually quickly when you get a signal, that can be done by putting a mini-panel available from some brokers or by an Manual trading EA which I use called MOI. The MOI full name is Manual Order Interface and it is found in Marketplace.  There are a bunch of these manual traders which usually let you set stops and targets at the same time. 

 

I agree with Micheal Maggi, you need source code of that indicator and then Create a new Project and select Expert advisor. Remove all EA codes and Paste your indicator Code. 
 And remove below code from your indicator.

#property  indicator_separate_window

 in void function you can use below code. add your Ordersend Code.

int start()
{

return(0);
}

Compile all the source code . Now you indicator is converted in Auto expert. Hope it work 

 
I agree with Michael Maggi as well, OrderSend() is disabled for an indicator execution mode, you just have to run your buttons in an expert advisor file. However, the use of iCustoms() is really vague and does not yield the desired results for me.

 
Malcolm Okechukwu:
I agree with Michael Maggi as well, OrderSend() is disabled for an indicator execution mode, you just have to run your buttons in an expert advisor file. However, the use of iCustoms() is really vague and does not yield the desired results for me.

A four year old thread!


Anyway, it is possible to code a trading panel in an Indicator and have it send orders.

You just need to have a separate EA act as a listener, send a custom event from the indicator to the EA to trigger it, and store the parameters in a file.

It was a fun exercise to build this, but I didn't end up using it for anything. Trading panels are best written in an EA.

 
Anthony Garot: Anyway, it is possible to code a trading panel in an Indicator and have it send orders. You just need to have a separate EA act as a listener,

Correct. My GUI EA was originally exactly that, and indicator and listener. OP may want to look at the original code vs. mine.
          for MT4): 'Money Manager Graphic Tool' indicator by 'takycard' - Risk Management - Articles, Library comments - MQL5 programming forum - Page 6 #55

Reason: