What does the number first mean? On each timeframe the current candle has an index of '0'.
For 5, counting from zero, you need the number of the first candle of that week, for example on Monday at 12 on the hour chart, the first candle will have the index rates_total-11, of course you can cycle through it and see the difference in candle dates for over 2 days, but I think there is a more elegant solution.
For 5, starting from zero we need the number of the first candle in this week. For example on Monday at 12 on the hour chart the first candle will have rates_total-11 index , of course we can loop through it and see the difference in candle dates for more than 2 days, but I think there is a more elegant solution.
The current candlestick (on any timeframe) has the index '0', respectively the previous candlestick has the index '1'.
When working in the indicator, the current candlestick has the index 'rates_total-1' (if you don't flip arrays).
The question is not about that, I need the index of the first candle of the current week.
In mql4, there was the DayOfWeek() function that could simply calculate the index I need.
An index is an index. The current candle on any timeframe is index '0'.
Maybe you need to rephrase your question as follows: "I work in the INDICATOR on timeframe H1 and I need to know the index of the first candle on a given day of the week. Have I phrased your question correctly?
An index is an index. The current candle on any timeframe is index '0'.
Maybe you need to rephrase your question as follows: "I work in the INDICATOR on the H1 timeframe and I need to know the index of the first candle on a given day of the week". Did I phrase your question correctly?
I need to loop through the candlesticks in the indicator, but not from the 0th but from the first candlestick of the previous week.
for(int i=0; i<rates_total; i++) - this is all bars
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
What does the number first mean? On each timeframe the current candle has an index of '0'.
For 5, counting from zero, you need the number of the first candle of that week, for example on Monday at 12 on the hour chart, the first candle will have the index rates_total-11, of course you can cycle through it and see the difference in candle dates for over 2 days, but I think there is a more elegant solution.
Good evening.
Do you know if you can use MQL5 to find out if the Expert Advisor is in tester mode or in real trading mode? If so, how?
Thank you.
For 5, starting from zero we need the number of the first candle in this week. For example on Monday at 12 on the hour chart the first candle will have rates_total-11 index , of course we can loop through it and see the difference in candle dates for more than 2 days, but I think there is a more elegant solution.
The current candlestick (on any timeframe) has the index '0', respectively the previous candlestick has the index '1'.
When working in the indicator, the current candlestick has the index 'rates_total-1' (if you don't flip arrays).
The current candlestick (on any timeframe) through CopyXXX operation has index '0', respectively the previous candlestick has index '1'.
When working in the indicator, the current candle has the index 'rates_total-1' (if not to flip arrays).
The question is not about that, we need the index of the first candle of the current week.
In mql4, the DayOfWeek() function allows me to simply calculate the index I need.
The question is not about that, I need the index of the first candle of the current week.
In mql4 there was a function DayOfWeek() where you could simply calculate the index I need.
You can see the commission in the TRADE ( Class CDealInfo.Commision) or in the POSITION ( Class CPositionInfo.Commission )
Thank you. What about identifier POSITION_COMMISSION ?
It is not highlighted in the editor, and it is not in Help.
Thank you. What about POSITION_COMMISSION identifier ?
It's not highlighted in the editor and it's not in the help.
I have it figured out. It is in the trades in the history
The question is not about that, I need the index of the first candle of the current week.
In mql4, there was the DayOfWeek() function that could simply calculate the index I need.
An index is an index. The current candle on any timeframe is index '0'.
Maybe you need to rephrase your question as follows: "I work in the INDICATOR on timeframe H1 and I need to know the index of the first candle on a given day of the week. Have I phrased your question correctly?
An index is an index. The current candle on any timeframe is index '0'.
Maybe you need to rephrase your question as follows: "I work in the INDICATOR on the H1 timeframe and I need to know the index of the first candle on a given day of the week". Did I phrase your question correctly?
I need to loop through the candlesticks in the indicator, but not from the 0th but from the first candlestick of the previous week.
for(int i=0; i<rates_total; i++) - this is all bars
and we need something like:
X=(IndexFirstTradingWeek(EURUSD,H1))+120;
for(int i=(rates_total-X); i<rates_total; i++)