Like this?
Best posts made by roar
-
RE: First Candle of the Day, Locate and Identify???posted in Questions & Answers
@OntradingX I tried to use current timeframe, but there was an error with the quick example I made.
Here's corrected code:
int openid_current_tf = iBarShift(NULL, 0, iTime(NULL, PERIOD_D1, 0)); if(iClose(NULL, 0, openid_current_tf) > iOpen(NULL, 0, openid_current_tf)) Comment("Today started with a BULL candle"); else Comment("Today started with a BEAR candle");
-
RE: set stops robotposted in Questions & Answers
The same blocks as usual, just change the group filter.

-
RE: News during Backtestposted in Questions & Answers
@tec-nacks most news filters dont support that.
Technically its possible, if you get some kind of database of old news records. In fact, I'm willing to code it for you, if you really find such database.
-
RE: “ EA SUDDENLY COLLAPSE WHEN BACKTESTING WITH 2 DIGITS BROKER BUT NO PROB WHEN BACKTESTING WITH 3 DIGITS BROKER ( XAUUSD ) "posted in Questions & Answers
@kavmasayuki my example should work fine.
I dont use this feature myself, but this is how I understand it. -
RE: How to set EA Password for 1 account ?posted in Questions & Answers
Something like this in the On Init -tab should work.

-
RE: How much is TOO much?posted in Questions & Answers
@gooseman every indicator reserves some amount of your RAM memory. When you have 100 indicators with their memory allocations, there might not be space left for 101st.
Alternative structure: work with just 1 group of blocks, but run the same blocks multiple times, changing the symbol in between. You can put the symbols in an array.
-
RE: Is possible to use a mql5 indicator in an EA?posted in Questions & Answers
@gery https://www.mql5.com/en/docs/constants/indicatorconstants/prices
it must be exactly "ENUM_APPLIED_PRICE"
-
RE: Martingale principlesposted in Questions & Answers
@Abade69 to play devils advocate: the statistical metrics for walk-forward system tells how good the EA is fitting different strategies (parameter combinations) to sections of history data, right? There is less evidence that the latest strategy will work today and tomorrow
-
RE: candle ID in lower TFposted in Questions & Answers
Record the datetime value of hourly candle:
datetime timevar = iTime(NULL, PERIOD_H1, 123);Get the candle ID from that time, in selected timeframe:
int idvar = iBarShift(NULL, PERIOD_M1, timevar);https://www.mql5.com/en/docs/series/itime
https://www.mql5.com/en/docs/series/ibarshift -
RE: close all trade button not workingposted in Questions & Answers
-
You need to draw your button just once, not on every tick or every chart event. Move the draw button to On Init.
-
When checking the mouse clicking, you are looking for a different name - "Button1" vs "button 1"
-
-
RE: My Indicator generates compliation errorsposted in Questions & Answers
Datatypes (int, bool) are lower case
-
RE: Expert properties displayposted in Questions & Answers
@talshemtov you need to declare a new constant for each MA setting. Find the correct enumeration from mql5.com:
https://www.mql5.com/en/docs/constants/indicatorconstants/enum_ma_method
-
RE: Button Click Open New Chartposted in Questions & Answers
Basically you can just use the ChartOpen function: https://www.mql5.com/en/docs/chart_operations/chartopen
-
RE: Custom Indicator not showing data after X barsposted in Questions & Answers
@joseanrod the total number of bars is in variable called Bars.
But the indicator probably needs some history before it can start calculating the indicator results, so you can try something like this:i = Bars - 100; -
RE: How to do I build a multi timeframe\symbol portfolio?posted in Questions & Answers
@gooseman ok, if MA has a variable timeframe as well, its better to use slightly different structure.
- Start with the market selection loop
- Record the currently selected market into "market" variable
- Run a checkup in custom block: if market is this, set timeframe to this and set rsi target level to this
- Apply the found timeframe to every next block
- Run the MA and RSI conditions with the previously selected variable timeframes and target levels
-
RE: How to do I build a multi timeframe\symbol portfolio?posted in Questions & Answers
@gooseman so you have different RSI timeframes and different RSI levels for each symbol?
In that case, I would first record the RSI on all timeframes into their own variables, also record the currently selected market, and then do the symbol + RSI check in one big condition block.
For the syntax, && means "and", || means "or".This doesnt compile since I dont have all your variables, but I hope you get the idea
https://fxdreema.com/shared/D0LMD4HncTo avoid the unnecessary loading of all RSI timeframes for all symbols, you could first do a checkup for the correct TF for the selected symbol, but it is not strictly needed
-
RE: How to do I build a multi timeframe\symbol portfolio?posted in Questions & Answers
Just put the market loop on top. Dont use the other filters - symbol or group - in other blocks.
If you have special settings for each symbol, then you need an array.

-
RE: How to do I build a multi timeframe\symbol portfolio?posted in Questions & Answers
@gooseman why do you have the same symbol repeating multiple times there?