Stopping an order with OrderSend at 1000EUR

 
Hey guys,

i hope someone is able to help me: i want to close an order with an ordinary OrderSend command (with stop) like this:
STOP=??????????;

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,STOP,Ask+TakeProfit*Point,"macd sample",16384,0,Green);



but to stop it in a usual way like: STOP=Bid-30*Point;(30 are 30 pips) is useless in my case. I need some code or a formula, which enables me to give the script a total stop order like "1000" EUR.

For instance i have bought something for 100,000EUR and the profit of the open order is actually -1000 . So it should automatically close. Put it in a OrderClose command isn't an option, i must use the OrderSend function. Any ideas? My idea is, filling the questionmarks with a calculation (Lots, worth of a lot, etc.) but i can't get it. Please help!
-----------------------
I hope i've written it understandable. English isn't my native language.
 
milbman wrote >>
Hey guys,

i hope someone is able to help me: i want to close an order with an ordinary OrderSend command (with stop) like this:
STOP=??????????;

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,STOP,Ask+TakeProfit*Point,"macd sample",16384,0,Green);



but to stop it in a usual way like: STOP=Bid-30*Point;(30 are 30 pips) is useless in my case. I need some code or a formula, which enables me to give the script a total stop order like "1000" EUR.

For instance i have bought something for 100,000EUR and the profit of the open order is actually -1000 . So it should automatically close. Put it in a OrderClose command isn't an option, i must use the OrderSend function. Any ideas? My idea is, filling the questionmarks with a calculation (Lots, worth of a lot, etc.) but i can't get it. Please help!
-----------------------
I hope i've written it understandable. English isn't my native language.


https://www.mql5.com/en/forum/123914
Use the search function here in the forum and you will find lot about this.
Two ways you have...
You have a fixed stoploss f.e. 30 pips, then you can calculate the lotsize for dont loose more then 1000 Eur.
Or you have a fixed lotsize, then you can calculate your Stoploss for dont loose more then 1000 Eur...