Errors, bugs, questions - page 944

 
Sergey5347:

Hello, everyone!

Guys who knows. I wrote an EA in mq5 (my first EA) and I am running it. I am trying to open orders (instant execution) but stop loss is not set (although it is in code). I didn't see any error in order execution, but I didn't see any stop loss. I have looked in the FAQ and tried different methods to set orders. I have also tried using the library connection. All without errors, but no stop loss.

I think it may be the mq5 itself. I am using Alpari. It would be a pity if I have no idea what to do with it.

Sincerely,

Sergey

Without a code example of how you set the stops, it's hard to tell where the error is. Maybe you will find something useful in the article Trading operations in MQL5 - it's simple, in the section "CTrade - handy class for trading operations".
 
uncleVic:

When an object is changed, the CHARTEVENT_OBJECT_CHANGE event is received. The sparam parameter contains the name of the object. I.e. it should be written like this:

Where you insert this (in a separate method or in the body of the handler) is your decision.


Thank you for your reply. Can I say a few more words about ON_EXTERNAL_EVENT - in what situations should it be used?
 
paladin800:
Without a code example of how you set the stops it's hard to tell where the error is. Maybe, you will find something useful in the "CTrade - easy class for trading operations" article in MQL5.

Thanks guys. I unloaded straight blocks from this article for testing, it worked without errors, but I don't see the stop loss in the terminal...

Maybe mt should be reinstalled?

 
Sergey5347: Should mt be reinstalled?
Did you work through my comment?
 
Yedelkin:
Have you worked through my comment?

Thank you for the answer! I'm working on it now.

Are you referring to the sequence of actions a dealer performs when a request to open a position appears?

Best regards,

Sr.

 
Sergey5347: Are you referring to the sequence of actions the dealer performs when there is a request to open a position?
No. It has nothing to do with the sequence of dealer's actions. The structure of a trade request includes different variants of filling out the request depending on the mode of trade order execution. The mode is set by the dealer/broker. You need to understand which mode is set for your demo account, and which fields of the trade request are relevant for this mode.
 
Yedelkin:
No. It has nothing to do with the sequence of dealer's actions. The structure of a trade request implies different variants of request filling depending on the mode of trade order execution. The mode is set by the dealer/broker. You need to understand which mode is set for your demo account, and which fields of the trade request are relevant for this mode.

Ahh... Thanks. I'll check with the brokers then. I'll ask them about it.

Thanks for the reply! )

Regards,

Sergey

 
Sergey5347: ahh... Thanks. I'll check with the brokers then. I will ask them about it.

If you are a programmer, you can find this out for yourself. Here, there is such an enumeration:

ENUM_SYMBOL_TRADE_EXECUTION

Identifier

Description

SYMBOL_TRADE_EXECUTION_REQUEST

Trade on request

SYMBOL_TRADE_EXECUTION_INSTANT

Trade at streaming prices

SYMBOL_TRADE_EXECUTION_MARKET

Execution_execution_market

SYMBOL_TRADE_EXECUTION_EXCHANGE

Exchange execution

Try to figure out how to get the right information yourself.

 
Yedelkin:

If you are a programmer, you can find this out for yourself. Here, there is such an enumeration:

ENUM_SYMBOL_TRADE_EXECUTION

Identifier

Description

SYMBOL_TRADE_EXECUTION_REQUEST

Trade on request

SYMBOL_TRADE_EXECUTION_INSTANT

Trade at streaming prices

SYMBOL_TRADE_EXECUTION_MARKET

Execution_execution_market

SYMBOL_TRADE_EXECUTION_EXCHANGE

Exchange execution

See for yourself how to get the information you need.

Aha, thank you! Thanks for the full information.
 

Guys, it turned out to be simple. If you get the same problem as I did (my sl was not set when the EA was running. If the same thing pops up on me (my EA didn't set sl), it means that the broker just doesn't support mt5. that's all...

Thanks guys for the help.

WITH RESPECT,

Sergey