Beginner Help?

 

Hello, sorry to annoy you with beginner questions, but believe me when I say I've tried for 2 days straight using google...

I've switched from MQL4 to MQL5, and I'm surprised how hard it is to even have my EA make a trade. Can somebody tell me what I'm doing wrong here:

I filled out my " MqlTradeRequest request;" in the following way (I print out these values each tick):


2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) comment: stuff

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) type_filling: 0

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) type: 0

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) deviation: 0

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) tp: 1.12029

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) sl: 1.11929

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) price: 1.11979

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) volume: 0.1

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) symbol: EURUSD

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) magic: 9996

2015.02.26 23:19:27.015 FirstOne (EURUSD,M1) action: 1

 

 When I send these into the ordersend(request,result); I get result.comment: "Invalid request".

I question the "action" and the "type_filling" 

I declared them like this:

request.action=TRADE_ACTION_DEAL; 

request.type_filling=ORDER_FILLING_FOK;

 Help is appreciated! =) 

 
MqlTradeRequest request={0};

Better to show your code when you need coding help

 
angevoyageur:

Better to show your code when you need coding help.

Wow, that simple huh? Thanks a bunch! =)

And good point on the code, will do next time.  

Reason: