Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 996

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
You can use arrays and functions
That's why I'm asking you, I'm racking my brain on how to do it.
So far, only generalities have been talked about.
You can't do it without specifics.
Bring me the code that has racked my brain
So far we've only talked about the general.
It won't work without specifics.
Give me the code that broke my head
This is for the M15. Every N minutes is a variable, for M15 there are 96 of them. I would like to get a beautiful code instead of this disgrace.
This is for M15. Every N minutes is a variable, for M15 there are 96. I would like to get a nice code instead of this mess.
To make the right decision, you need to understand what you want to get
This is for M15. Every N minutes is a variable, for M15 there are 96. I would like a nice code instead of this mess.
That's why I'm asking, because I'm racking my brain on how to do it.
or immediately without comparing and overriding, just enlarging the desired cell:
Dear gurus, please, help me to understand my newbie's confusion!
I am trying to understand how indicators written in MT4 work. I expect that indicators are calculated based on bars, i.e. if I set Period (=) 13 in Custom Moving Average indicator parameters, it is about averaging over 13 bars of the appropriate chart.
But I don't see any event handler like OnBar, only OnTick. It means that (my) indicator should automatically "form" bars from ticks by grouping them, say, by minutes (for servicing the chart M1)?
I look in the code of a ready-made indicator Custom Moving Average - it doesn't have OnTick ... The appropriate Calculate event in the manual says:"The Calculateevent is generated only for indicators [...] and at any change of price data". In other words, OnCalculate responds to each tick?
Dear gurus, please, help me to understand my newcomer's confusion!
I am trying to understand how indicators written in MT4 work. I expect that indicators are calculated based on bars, i.e. if I set Period (=) 13 in Custom Moving Average indicator parameters, it is about averaging over 13 bars of the appropriate chart.
But I don't see any event handler like OnBar, only OnTick. It means that (my) indicator should automatically "form" bars from ticks by grouping them, say, by minutes (for servicing the chart M1)?
I look in the code of a ready-made indicator Custom Moving Average - it doesn't have OnTick ... The appropriate Calculate event in the manual says:"The Calculateevent is generated only for indicators [...] and at any change of price data". In other words, OnCalculate responds to each tick?
For each tick, if you use Close[0]. You can use Close[1] or Open[0], then you will see the change only when you change the bar.
-- sorry, theCustom Moving Average indicatorCANNOT average over ticks. How would it work (look) then on a daily timeframe, for example - can you imagine?
It's OK, only the zero (unfinished) bar is recalculated. But it is the bars, the prices of the bars, that are being averaged. If you set appled_price -- PRICE_CLOSE, it will read the close prices of the bars, but not all ticks.
Generally speaking, on an unfinished bar, the close price is equal to the Bid price and, if this price changes, the indicator will summarize 13 price values and divide them by 13. Not long at all...
double iMA(
string symbol, // имя символа
int timeframe, // таймфрейм
int ma_period, // период
int ma_shift, // сдвиг средней
int ma_method, // метод усреднения
int applied_price, // тип цены
int shift // сдвиг
);