- Why did you post your MT4 question in the Root / MT5 General
section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. -
double Momentum(){ double moment= iMomentum(NULL,0,period,PRICE_CLOSE,0); return(moment); Comment("Momentum = ",DoubleToStr(Momentum(),3)); < not called. }
Your function doesn't call Comment so of course nothing changes. - Your function doesn't have an array, so why is that mentioned?
William Roeder:
Thanks for the response.- Why did you post your MT4 question in the Root / MT5 General
section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Your function doesn't call Comment so of course nothing changes.
- Your function doesn't have an array, so why is that mentioned?
Sorry, the site is not very intuitive and I used my old bookmarks which use to take me to MT4 forums section directly. However, when I login by default the site brings me to MT5 forums. General section at the top is not clear to suggest "MT5 only" and the long list of questions underneath the MT5 General section also show many similar MT4 questions within.
I was not aware of this and will properly post in the correct section in the future.
I was not aware that the indicators were not an array. I have a lot of catching up to do and forgot a lot of what I once knew about this. I was sort of thinking of the shift option for indicators and assumed this was an index so I concluded an array without knowing anything about it.
I will follow up on how to call Comment to refresh the value of Comment, thanks
![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
The value of my Comment doesn't change once it is initialized.
I"m sure it has something to do with the docs below, but I'm not 100% sure because the Comment does initialize and show the value exactly 1 time then it's static from there on.
From the docs.
Please describe "Arrays cannot be passed to Comment() Function".
https://docs.mql4.com/common/comment
My code sample:
I'm sure I've missed something simple on this but it's been a while since I've coded anything.
Please advise.
Thanks