Download MetaTrader 5

what does result code 10006 suggest?

To add comments, please log in or register
sd2000sd
212
sd2000sd  

I am using CTrade class and sending a buylimit request. but I get the result of 1006!

I am using this to get the result code: 

Print(trade.ResultRetcode() );

 

what is the problem ? can anyone help me? 

Alain Verleyen
Moderator
32007
Alain Verleyen  
sd2000sd:

I am using CTrade class and sending a buylimit request. but I get the result of 1006!

I am using this to get the result code: 

Print(trade.ResultRetcode() );

 

what is the problem ? can anyone help me? 

Do you know there is a lot of documentation accessible from MetaEditor or on this side. Have you checked it before posting ?

Error 10006 means your request was rejected, so you probably have an error in your code. You can post it if you need help.

sd2000sd
212
sd2000sd  
angevoyageur:

Do you know there is a lot of documentation accessible from MetaEditor or on this side. Have you checked it before posting ?

Error 10006 means your request was rejected, so you probably have an error in your code. You can post it if you need help.

CTrade trade;
   trade.SetTypeFilling(ORDER_FILLING_RETURN);
   trade.BuyLimit(2563,3733,"symbolName",0,0,ORDER_TIME_DAY);
   

this is my code.

What is wrong with it? 

I just dont want to mention my symbol name, that is the reason why I have used "symbolName". But I am sure there is no problem with that. 

Alain Verleyen
Moderator
32007
Alain Verleyen  
sd2000sd:

this is my code.

What is wrong with it? 

I just dont want to mention my symbol name, that is the reason why I have used "symbolName". But I am sure there is no problem with that. 

First parameter of BuyLimit() is volume, are you sure of 2563 ?

Are you sure that ORDER_FILLING_RETURN is available for this symbol and order type ? Are you sure that ORDER_TIME_DAY is available for this symbol ?

sd2000sd
212
sd2000sd  
angevoyageur:

First parameter of BuyLimit() is volume, are you sure of 2563 ?

Are you sure that ORDER_FILLING_RETURN is available for this symbol and order type ? Are you sure that ORDER_TIME_DAY is available for this symbol ?

I am testing my code right now, and at this hour of the day, the market is closed.

Can that be the reason of the code : 10006?

sd2000sd
212
sd2000sd  

when I use a demo account, my code works without any problem but when I use my real account my code does not work and gives error 10006.

what is wrong?!!!

Please help! 

Alain Verleyen
Moderator
32007
Alain Verleyen  
sd2000sd:

I am testing my code right now, and at this hour of the day, the market is closed.

Can that be the reason of the code : 10006?

I suppose that you can't place a buylimit if market is closed. Which kind of symbol is it ? stock, futures ?
sd2000sd
212
sd2000sd  
angevoyageur:
I suppose that you can't place a buylimit if market is closed. Which kind of symbol is it ? stock, futures ?
stock
sd2000sd
212
sd2000sd  
sd2000sd:
stock

I had the same problem with using the trade functions, like ordersend(), when I used them with a demo account I had no problem but with the real accoun I had the same "rejected" problem.

Mehrdad Shiri
4568
Mehrdad Shiri  
angevoyageur:

I suppose that you can't place a buylimit if market is closed. Which kind of symbol is it ? stock, futures ?

sd2000sd 2014.01.29 18:50 FA
angevoyageur:
I suppose that you can't place a buylimit if market is closed. Which kind of symbol is it ? stock, futures ?
stock

hi angevoyageur:

i think sd2000sd talk about iranian stock . ( he dont  reply to my pm until now)

i solve my problem like this, for similar condition .

i must add :

angevoyageur:
I suppose that you can't place a buylimit if market is closed. Which kind of symbol is it ? stock, futures ?

we can put manually , buy limit when market is closed or modify them

but expert can not send order or modify them ( i use void OnTick()  )

To add comments, please log in or register