Description:
OpenBuyPosition script is developed for buying with fixed Stop Loss and Take Profit values in points from the current price. The main advantage of this script is its ability to fix a deal volume, which depends on the entire deposit size, using MM (Money Management) script input parameter. This script determines a ratio between the amount of funds involved in the deal and all the funds of the deposit.
The script input parameters:
//+----------------------------------------------+ //| SCRIPT INPUT PARAMETERS | //+----------------------------------------------+ input double MM=0.1; // Money Management input int DEVIATION=10; // Price deviation input int STOPLOSS=300; // Stop Loss in points from the current price input int TAKEPROFIT=800; // Take Profit in points from the current price input uint RTOTAL=4; // Number of repeats in case of unsuccessful deals input uint SLEEPTIME=1; // Pause duration between repeats in seconds
Hello
Could you also make a "closeall" script wich will close all open positions ?
Thank yu
Hi nonor,
If you want to close a sell position, the you should open a buy position with the same lot and vice versa.
Do this : on your MetaTrader 5, open sell some symbol - say 1 lot of EURUSD. To close it, open buy 1 lot of EURUSD..
Hi nonor,
If you want to close a sell position, the you should open a buy position with the same lot and vice versa.
Do this : on your MetaTrader 5, open sell some symbol - say 1 lot of EURUSD. To close it, open buy 1 lot of EURUSD..
yes, but in mt4, I have a script wich I call by keys, Alt+c, and then positions are closed, it a kind of emergency close...
Hi nonor,
Yep, I also have that in MT4 :D. However, MT4 is ticket based trading while MT5 is position base trading. I think close all can be applied in MT5 too, it just like I said before that's the way to close any open position in MT5 :(.
hi Nikolay
Was looking for a scrip like this great idea...tried using the scrip by attaching it to the chart but it immediately gets removed automatically fom the chart .
what do you think could be the problem
The orders are placed, but no StropLoss and Takeprofit are set. I tryed to check the code, failing.
What's wrong in the code for not setting those parameters ?
thanks