Download MetaTrader 5

order send error 130 on setting 30 pips stoploss and trailing stop

To add comments, please log in or register
Kiran Chandekar
1478
Kiran Chandekar  
I am getting order send error 130. If I try this on demo server of mt4 it works. But if I test in real account of broker instaforex it does not work. What could be the reason.
Files:
whroeder1
15592
whroeder1  
  1. //| This MQL is generated by Expert Advisor Builder                  |
    
    https://www.mql5.com/en/forum/139865 we hate EA builder. It generates bad code. You haven't learned the language so there is no common language to communicate with you. 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.
  2.    Total = OrdersTotal();
    Incompatible with every other EA (including itself on other charts) and manual trading
  3.                OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);
    
    What are Function return values ? How do I use them ? - MQL4 forum
  4. Not adjusting for 4/5 digit brokers
    extern int StopLoss = 50;
    extern int Slippage = 3;
    5 pip SL. and 0.3 pip slippage.

  5. extern double Lots = 5;
    
    What is the maximum lot size allowed by your broker?
Kiran Chandekar
1478
Kiran Chandekar  

I know that if the code is working in mql4 demo server . It should work on my broker. It seems broker has some restriction while entering order with stoploss. If I change my stoploss to 50 from 30 then EA is working fine.

Simon Gniadkowski
Moderator
18024
Simon Gniadkowski  
kcfve123:

I know that if the code is working in mql4 demo server . It should work on my broker. It seems broker has some restriction while entering order with stoploss. If I change my stoploss to 50 from 30 then EA is working fine.

You need you code to check that the Order you are about to send complies with this: Requirements and Limitations in Making Trades
To add comments, please log in or register