Forum

OnDeinit() function, does execute on close MT5?

Hi guys, I hace several questions about OnDeinit function When close MT5 does this function works? I mean, I use 100 charts, each one with the same indicator. If I create a function that deletes all indicators of all those 100 charts into OnInit, It will work? My problem is that I use the same 3

[SOLVED] CopyBuffer() error, or empty value

Hi guys, I'm trying to get a value of a variable from a custom indicator using CopyBuffer without succes and I don't understand why. This is my Indicator file mql5 double CandlesticksPatterns[ 1 ];-----------------------------------------//I've set the array 1 because if empty i get error 4806 (I

Place only once BuyStop / SellStop even for several positions of the same type.

Hi, I use this part of script to place a BuyStop order or SellStop order. It works fine when I have one position of a type (Buy or Sell). But when I have 2 position of the same type it places 2 orders at the same time even if I set to not do it with (TotalSellStop<1) (TotalBuyStop<1). How can I fix

Can´t get active positions count on mql5

I can´t get te number of active positions. It counts +1 for every tick while position is open. How can i do it? Please. Thanks a lot. for ( int i= 0 ;i< PositionsTotal ();i++) // Go through all positions if (m_position.SelectByIndex(i)) // selects the position by index for further access to

Total Buy lots and Total Sell Lots from mql4 to mql5

How this code would be for MT5? double totalBuyLots = 0 ; double totalSellLots = 0 ; for ( int i= 0 ; i < OrdersTotal (); i++) { if ( OrderSelect (i, SELECT_BY_POS, MODE_TRADES) == true ) { // match the symbol EUR/USD or EUR/CHF, etc