FxPro EA test [Unsupported filling mode]. - page 2

 
Zbigniew Sobczyk:

It is not true. I checked in my EA this code:

   ENUM_ORDER_TYPE_FILLING filling = SymbolInfoInteger(_Symbol, SYMBOL_FILLING_MODE);
   Comment(StringFormat("%i | %i", filling, ORDER_FILLING_IOC));

 And the result is: 2 | 1, so ORDER_FILLING_IOC mean 1.

So what ? You are mixing SYMBOL_FILLING_IOC and ORDER_FILLING_IOC.
 
Zbigniew Sobczyk:

I think it's an error in MT5 or in documentation. I found this: https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#symbol_filling_mode

where is written that value of SYMBOL_FILLING_FOK is 1 and value of SYMBOL_FILLING_IOC is 2. This is wrong.

The documentation is just fine.
 
Alain Verleyen:
So what ? You are mixing SYMBOL_FILLING_IOC and ORDER_FILLING_IOC.


I think so Alain, may I ask you the difference and how to handle that. It might sounds basic but I am really struggling since quite some time on that.

Regards,

G

 
gringoh:


To be honest, I am completely lost, what I have coded above is working fine but in order to close an order, I tought a simple trade.PositionClose(ticket, 1000); would work and no.

I am completely lost with your topic. I was about filling mode, now you are saying "is working fine". So what is your problem actually ?
 
gringoh:


I think so Alain, may I ask you the difference and how to handle that. It might sounds basic but I am really struggling since quite some time on that.

Regards,

G

Please explain your problem. Show the code you are using, and explain the problem you have.
 

As explained in post 1, I am using ORDER_FILLING_IOC to open trades, now when I want to close a trade as I am using the CTrade class, I thought I could simply use trade.PositionClose(ticket, 1000) to close the trade but it is not working.

 

 
gringoh:

As explained in post 1, I am using ORDER_FILLING_IOC to open trades, now when I want to close a trade as I am using the CTrade class, I thought I could simply use trade.PositionClose(ticket, 1000) to close the trade but it is not working.

 

Sorry I was confused by Zbigniew messages.

To close a position on netting mode you just have to use code like :

         if(!trade.PositionClose(symbol))
           {
            //TODO error checking
           }
 
Alain Verleyen:

Sorry I was confused by Zbigniew messages.

To close a position on netting mode you just have to use code like :

         if(!trade.PositionClose(symbol))
           {
            //TODO error checking
           }

Thanks Alain, I was so focused on closing the order with Ticket while closing with Symbol is working fine ;-)

 

I can move on to the next step now, the hedging mode.

 
gringoh:

Thanks Alain, I was so focused on closing the order with Ticket while closing with Symbol is working fine ;-)

 

I can move on to the next step now, the hedging mode.

why~~~~~

 
CodingCoder:

why~~~~~

Why what ?
Reason: