You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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
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.
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?
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.
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
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.
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.
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