Market Properties > Timeframe doesn't come through in Alerts
-
Hi,
I'm trying to send the Timeframe information through (e.g. M5 or H1 etc...) in an "Alert Message" and it's coming through as "0" regardless of the Timeframe I place the EA on. I'm selecting Market Properties > Timeframe in the Data Row.
Is there a bug with this option, or is there something different I should be doing?
-
Here you can see actual values of timeframes: http://docs.mql4.com/constants/chartcon ... timeframes
M1, M5, M15... this means nothing. These are only short names. There are predefined constants like PERIOD_M5 that has values like 5, which is basically the number of minutes within the timeframe.
-
I see what you mean.
From what I can see, my notification is picking up the PERIOD_CURRENT which returns zero.
There are not other options within FXdreema to change the Timeframe option to choose a period number, e.g. PERIOD_M1. Is there another way to do it?
-
You are trying to set the timeframe as input parameter?
I can see your projects and I just looked at your current project. There are some things there...
First, I really don't recommend you to use those checkboxes that sets parameters as input parameters. Instead, define some Constants: https://fxdreema.com/demo/mt4-constants For period parameter, use ENUM_TIMEFRAMES as datatype if you want MetaTrader to give you drop-down menu with all available timeframes. ENUM_TIMEFRAMES is just some fancy data type that is actually integer, but tells MetaTrader to treat these variables differently in some situations.
Another thing is, when you use those pink blocks, especially in MT4, you should also use one of "For each..." block: https://fxdreema.com/demo/mt4-loop-how-it-works -
Ideally not wanting Timeframes to be an input parameter, but if that's the only way I can do it then yes.
Will have a look at the other comments you make and see if I understand what you're saying. Cheer!
-
The project you reviewed is not the one I was refering to, the one I'm referring to is called "MTM Trendline EA".
Cheers
-
Fixed
