Unexplainable Error 130 on Modify Order · · · – – – · · · - page 3

 
Duarte Silva:

Ernst, thank you for the help!

If you don't mind I would like to know how do you get there? It was the string conversion that doesn't work? The code has the same value: order index, SL values, type of order...

One more question: I was searching on the mql4 book for operand/expressions to understand the structure of the code that you have written:  "MarketStopLevel = (minStop>0.0)?minStop:MarketStopLevel;"

Can you give a link to read?

The problem was the order ticket (post 8).

MarketStopLevel = (minStop>0.0) ? minStop : MarketStopLevel;

is simply a shorthand if else statement.

 
Marco vd Heijden:

It wasn't the string conversion because:

Now you successfully hired Ernst for a couple of days to,

https://www.mql5.com/en/docs/basis/operators/ternary

Marco,

When I saw yesterday the correction of Ernst I have remember your comment to one topic that I have made before, where you already suggested to use switch instead of string and then:

OP_BUY

0

Buy operation

OP_SELL

1

Sell operation

OP_BUYLIMIT

2

Buy limit pending order

OP_SELLLIMIT

3

Sell limit pending order

OP_BUYSTOP

4

Buy stop pending order

OP_SELLSTOP

5

Sell stop pending order

 

But I didn't understand well! I was thinking that you mean put the number of the type in the function, ex: ModifyOrders("1") instead of ModifyOrders(OP_BUY).

I have to thank you also for the help. My mistake! Sorry...