Download MetaTrader 5
To add comments, please log in or register
Have you discovered something really important? Write an article and receive 200 USD!
underthesun22 2014.09.27 09:54 

Hello people,

I need help with the making of a simple program with MetaEditor. The program is simple: it should make an order (for exaxt time) and also move the stop lose line along with the price of the current product. For example i want to make an order to buy 10000 euroes (EUR/BGN) at 19:00 (now is 12:53), and also

if the price is 1.000 and the stop loss is at 0.990, if the price moves up to 1.020 then the stop loss should also move to 1.010. Thank You for the help.

SYED NAUFAL GADDAFI 2014.09.27 10:28
whroeder1 2014.09.27 13:27  
underthesun22: I need help
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Donald Gibson
Donald Gibson 2014.09.27 17:21  
//-------------------------------------------------------------------------------------------------Auto Adjust Stop Loss   
void AutoAdjustStopLoss()
//-------------------------------------------------------------------------------------------------Risk Management

   double ATR=iATR(Symbol(),0,atrperiod,1);

   double SL = NormalizeDouble(ATR * 2,Digits);
   double TP = NormalizeDouble(ATR * atrmultiplier,Digits);


   for(int cnt=0; cnt<OrdersTotal(); cnt++)
                  Alert("Auto Buy SL Error Occured : "+ErrorDescription(GetLastError()));
               Alert("Auto Sell SL Error Occured : "+ErrorDescription(GetLastError()));

//-------------------------------------------------------------------------------------------------End Auto Adjust Stop Loss

i have a function that does the same and uses the ATR for setting the stops.

it moves the stoploss with every profitable tick at a per defined distance.

hope it helps

good luck

To add comments, please log in or register