![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Do you remember exactly where DebugBreak() was set?
No way to replicate it yet.
Made a request in servicedesk #18435
I set DebugBreaks before all loops.
Made a request at servicedesk #18435
Zy DebugBreaks put in before all cycles.
Yes, thank you.
Already did it again.
Yes, thank you.
Already did it again.
I would like to know the fate of request#18261 foran indicator call from an EA (the value does not match the indicator).
It would be nice if they responded in some way...
I have a question about MACD Sample.
I set an Expert Advisor with SL 50 and TP200 in the Alpari demo.
I opened a position on GBPUSD and after some time the Expert Advisor modified the position and entered into the log the following data
> 2010.07.08 20:01:46 Trades '3037120' : failed modify sell 0.10 GBPUSD sl: 1.51740, tp: 1.49868 -> sl: 1.51740, tp: 1.49868 [Invalid stops]
The question is why SL became disabled? The position seems to have been modified (or at least it was moved to BU before)...
At the same time strategy tester did not swear at all...
PS
File with the settings of the indicator is attached...
There is a two-dimensional array maVal[a][b] . How to copy muVal values to [b] as I need to browse the array by [a] and compare [b] values
CopyBuffer(maHandle,0,0,3,maVal); Not suitable. That's a cumbersome code.
sl: 1.51740, tp: 1.49868 -> sl: 1.51740, tp: 1.49868 [Invalid stops]
The question is why SL became disabled? It seems that position was modified (at least it was moved to BU before)...
We write a simple script:
We throw it sequentially on different timeframes of the same trading instrument, starting with M1 and going upwards. Result: On the timeframe from M1 to M30 the period is correct:
But on H1 timeframe an absolutely fantastic number is thrown.
The most interesting thing is that H2 timeframe, (as well as subsequent hourly) is not far away from H1 timeframe.
On H1 the period = 16386 , on H2 = 16387, on H3 = 16388 and so on - the numbers differ by the last digit.
I am not interested in the method of getting around this bug, but in fixing the bug itself. I want it to be removed at all.
We write a simple script:
We throw it sequentially on different timeframes of the same trading instrument, starting with M1 and going upwards. Result: On the timeframe from M1 to M30 the period is correct:
But on timeframe H1 an absolutely fantastic number is thrown out.
The most interesting thing is that H2 timeframe (as well as subsequent hourly timeframes) isn't far away from H1 timeframe.
On H1 the period = 16386 , on H2 = 16387, on H3 = 16388 and so on - the numbers differ by the last digit.
I am not interested in the method of getting around this bug, but in fixing the bug itself. So that it was not there at all.
> I am not interested in a way around this bug, but in fixing the bug itself. I dont want it to be there at all.
Don't think I'm being rude or pushy, but pointing out that this bug you just killed me...![](https://c.mql5.com/3/0/happyt1i.gif)
On the essence of the question (suggestions):
This is not MQL4, and Period() doesn't represent the number of seconds/minutes in TF.
To get number of seconds in a period you need to use PeriodSeconds function.
And if you try to express Period as a number, then you will get the numeric value corresponding to the identifier of the period in enumeration ENUM_TIMEFRAMES.
PS
When I need to translate Period in MQL4 format, I use this function:
And to avoid unnecessary questions about "periodization", here are two more functions: MinuteToPeriod and PeriodToStr.