Use Account Profit

 
I have a nice EA and would like to add the function where an order will close when it gets to a specific profit (dollars). I am trying OrderProfit() but have no luck in getting the EA to respond. It's pretty simple. I want to enter a dollar amount into the EA settings, and when the profit reaches that dollar amount I would like the order to close. I am very new to this, so I hope I am making sense. Can anyone give me a helping hand please?
 

Use:

AccountInfoDouble(ACCOUNT_PROFIT)
 
Fabio Cavalloni:

Use:

Thanks, I'll give that a go. Appreciated.

 
Fabio Cavalloni:

Use:

That works perfectly. Thank you so much.

 
hello , i want accounted only buy profit,  can i use account "ACCOUNT_PROFIT"??
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Account Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fabio Cavalloni #:T
AccountInfoDouble(ACCOUNT_PROF

Thanks Man

Reason: