Forum

MQL5 calling a .NET method with a returned value

The article https://www.metatrader5.com/en/releasenotes/terminal/1898 has an example on how the MQL5 can call a function of c# and return a value. I have done the short example, without success. My goal is to pass some values from MQL5 to a function in c# in order to do some calculations and the

OnBookEvent

Hello, I am really confused about the OnBookEvent. Once I run my EA, the first method that is executing is the OnBookEvent. It is executing the first 2 commands (variable declaration) and then it goes to the OnInit(). It never returns back to the OnBookEvent and it never the OnBookEvent get

Triggering an event after S/L and T/P occur

I make a Position with a S/L and a T/P. Once the S/L or T/P take place, I am wondering if there is any event which is triggered (Hendge Account). Thanks

Close Partially my Position in case of take profit

In case of reaching the take profit , my goal is to close partially my open position (instead to close my position completely). What is the most appropriate approach to achieve my goal? Is there such a command? Any suggestion is appreciated

unresolved static variable

struct myMqlTradeResult: MqlTradeResult { public : bool isSuccessful; }; //+------------------------------------------------------------------+ //| |