OrderSend Error 130 With Hardcode Values

 

I am NOT new to Forex, but I am new to MQL4. I succesfully programmed my EA but when it comes to OrderSend I keep receiving Error 130.

I read some other posts here that maybe it's a problem with the Bid Function, so I hardcoded the values (looking in the real charts) to see what hapen, and YET not working.

string strPar="EURUSD";

double dblBid=NormalizeDouble(MarketInfo(strPar, MODE_BID),5);

double dblAsk=NormalizeDouble(MarketInfo(strPar, MODE_ASK),5);

double dblPoint=0.0001;


//Print("ASK: "+dblAsk);

//Print("FORM: "+(dblBid-15*dblPoint));

//OrderSend(strPar,OP_BUY, 0.1,dblAsk,3,dblBid-55*dblPoint,dblBid+55*dblPoint);

OrderSend(strPar,OP_BUY, 0.1,dblAsk,3,1.37711,1.38019);


Alert(GetLastError());

I NEED HELP!!!

PD: There is a way to send an order WITHOUT specifiyng SL and TP??? I mean, why is mandatory?

 
abaye:

PD: There is a way to send an order WITHOUT specifiyng SL and TP??? I mean, why is mandatory?


ask your broker or any broker that Calls himself An ECN
 
qjol:

ask your broker or any broker that Calls himself An ECN


I don't understand what is the relation with the broker. THE SAME BROKER let you put an order MANUALLY WITHOUT SL AND TP!!! Besides you CAN put an order without SL and TP in MQL5, so...

Anyway, did you see something wrong with the code? Any suggestions?

My server from this Demo Account is IBFX Australia Pty Ltd

 
abaye:


I don't understand what is the relation with the broker. THE SAME BROKER let you put an order MANUALLY WITHOUT SL AND TP!!! Besides you CAN put an order without SL and TP in MQL5, so...

Anyway, did you see something wrong with the code? Any suggestions?

My server from this Demo Account is IBFX Australia Pty Ltd


i'm sorry I thought you were asking if u can send WITH SL & TP

abaye:


Anyway, did you see something wrong with the code? Any suggestions?

https://www.mql5.com/en/forum/129818

 

THANK YOU THANK YOU THANK YOU THANK YOU

Just explain to me. You did INDEED open the position WITHOUT SL AND TP, and after that you put it, right?

I am sorry for bothering you, but the problem is every single example you find on the net, doesnot work.

Thanks again

 
abaye:

I am sorry for bothering you, but the problem is every single example you find on the net, doesnot work.


this one worked ?
 

YES, it worked. I didnt have the time to figure out what was wrong with the first one, but it worked.

 
abaye:

YES, it worked. I didnt have the time to figure out what was wrong with the first one, but it worked.


I will tell you, u supposed to use OrderSend() witout TP & SL & thet useing OrderModify() 4 TP & SL
Reason: