trigger Open Trade and Close Trade in Indicator, Is it Possible?

 
I have a very simple trade strategy.
But I do not konow why it can not run in expert mode.

But my indicator work well.
Is it possible to " trigger Open Trade and Close Trade " from "indicator" ?

I only need Open and Close order in indicator.
only have a little trade signals in a long time,
we know indicator is calculated continuously,
why need Expert continuous to check indicator also?

I think use indicator to " trigger " Open Trade and Close Trade is more better !!!
 
I don't think so, but easy enough to try. Make a quick indicator with a single OpenTrade in the Start() loop. If it doesn't do anything, you have your answer. :)
 
why there is an expert anyway if you could open and close trade frm indicator? they are very different things designed for different purposes... you can trasport your piano with a ferrari (theoretically at least) but it's not designed for that and there are better ways to do that...
 
they are very different things designed for different purposes...

:)
why think so ?
they are related,
in fact, most time, use indicator to judge when to order !!!!
so set order when calculate indicator is reasonable.

in MT , indicator is designed for (1) chart display, and (2) expert use,

I only want OrderSend(....) and OrderClose(.....) function can yse in indicator.

in MT help, no explain which functions can be used both in expert and indicator.
 
okwh:
they are very different things designed for different purposes...

:)
why think so ?
they are related,
in fact, most time, use indicator to judge when to order !!!!
so set order when calculate indicator is reasonable.

in MT , indicator is designed for (1) chart display, and (2) expert use,

I only want OrderSend(....) and OrderClose(.....) function can yse in indicator.

in MT help, no explain which functions can be used both in expert and indicator.

Maybe the event trigger that determines which is for EA, which is for indicator. I am thinking of doing the same thing, to have a tools that close and open trade on my terminal. Tell me if you know anything. I would love to collaborate.

 
Riko Dewaner:

Maybe the event trigger that determines which is for EA, which is for indicator. I am thinking of doing the same thing, to have a tools that close and open trade on my terminal. Tell me if you know anything. I would love to collaborate.

you replied to a 14 year old thread, so I would not expect too much collaboration  :-)

You cannot use trading functions in an indicator.

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...