Close opened order by equity

 
Can anyone help me to code closes opened position by equity automatically, if it loss $100 it closes and if it profit $100 it closes, after closes it sets another $100 automatically.
 
Just OrderSelect() then check OrderProfit()
 

https://www.mql5.com/en/code/10387

three indicators for example to see how to calculate a profit history and open

 
RaptorUK:
Just OrderSelect() then check OrderProfit()

Actualy i use this already if (AccountEquity() > Profit), and the problem is everytime it closes i have to open my EA properties window to set $100 larger than my current equity for profit and $100 smaller than my current equity for loss. i.e if my base equity is $1000 i have to set $1100 for profit and $900 for loss, i need script that cam do this for me automatically. please help.
 
So you mean current Equity +- 10% ? and you can't code that ?
 
  1. Account equity will change continuously. Can't use if there could be additional open order such as your EA on other charts. Use OrderProfit to separate your order from all others.
  2. need script that cam do this for me
    No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
 
WHRoeder:
  1. Account equity will change continuously. Can't use if there could be additional open order such as your EA on other charts. Use OrderProfit to separate your order from all others.
  2. need script that cam do this for me
    No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.

I'm still learning from scratch, llittle by little.
 
RaptorUK:
So you mean current Equity +- 10% ? and you can't code that ?


well I've tried some thing like this to close all opened double profit_target = AccountEquity() * 10/100

double profit = AccountEquity() + profit_target

if (AccountEquity() > Profit)

and it doesn't work, i'm still learning, a hint would be much help

 
shenmve:


well I've tried some thing like this to close all opened double profit_target = AccountEquity() * 10/100

double profit = AccountEquity() + profit_target

if (AccountEquity() > Profit)

and it doesn't work, i'm still learning, a hint would be much help


We don't see your coding

How is this

double profit = AccountEquity() + profit_target if this is changing with every tick yes then.....

or what way do you close...

And Profit is not equal to profit

Reason: