I wonder if in the near future we will get support for using all processor cores, or if we will continue with the single‑threaded version.
For heavy computations, such as fractals for many candles and timeframes, this takes an extremely long time.
For example, when I scan 100 companies on the stock market, on all timeframes, it takes about 20–25 minutes.
If all processor cores were used, it would be much better.
MT5 is multi-core by design (make sure all local agents are enabled in Tester tab "Agents").
If your "scanner" is taking 25 minutes, the bottleneck is likely your code architecture, not the platform.
MT5 is multi-core by design (make sure all local agents are enabled in Tester tab "Agents").
If your "scanner" is taking 25 minutes, the bottleneck is likely your code architecture, not the platform.
Thank you for the clarification. I understand that MT5 uses agents for optimization and backtesting, but when using a custom indicator for real-time scanning, the process remains single-threaded within the indicator itself. Could you point me toward best practices for architectural optimization in MQL5? Are there specific approaches for parallelizing heavy computations (such as fractals across multiple timeframes) within a single indicator, or is it better to split the tasks across separate indicators?
i remember a similar thread, using an ea is better for multi symbol scanner.
"The following is about the full code to create a trading system of the Fractals' highs and lows."
//+------------------------------------------------------------------+ //| Fractals highs and lows.mq5 | //| Copyright 2022, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2022, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" //+------------------------------------------------------------------+ void OnTick() { //creating arrays double fracUpArray[]; double fracDownArray[]; //Sorting data ArraySetAsSeries(fracUpArray,true); ArraySetAsSeries(fracDownArray,true); //define frac int fracDef = iFractals(_Symbol,_Period); //define data and store result CopyBuffer(fracDef,UPPER_LINE,2,1,fracUpArray); CopyBuffer(fracDef,LOWER_LINE,2,1,fracDownArray); //define values double fracUpValue = NormalizeDouble(fracUpArray[0],5); double fracDownValue = NormalizeDouble(fracDownArray[0],5); //returning zero in case of empty values if(fracUpValue ==EMPTY_VALUE) fracUpValue = 0; if(fracDownValue ==EMPTY_VALUE) fracDownValue = 0; //conditions of the strategy and comment on the chart with highs and lows //in case of high if(fracUpValue>0) { Comment("Fractals High around: ",fracUpValue); } //in case of low if(fracDownValue>0) { Comment("Fractals Low around: ",fracDownValue); } } //+------------------------------------------------------------------+
- 2022.10.24
- www.mql5.com
Forum on trading, automated trading systems and testing trading strategies
Need Help: EA with multiple Timeframe
Marco vd Heijden, 2018.09.17 12:56
yes you can define two timefames like this :
static input ENUM_TIMEFRAMES timeframe_1=PERIOD_D1;// Timeframe 1 static input ENUM_TIMEFRAMES timeframe_2=PERIOD_W1;// Timeframe 2
[T]he above will obviously need to be modified to include multi symbols.
Yeah. 100 symbols is rather heavy. I recall Fernando having posted elsewhere that an EA can only receive a tick from the current chart to which the EA is attached in MT5 at any given time (all rates arrive based on that)─and opening 100 charts running EA's doesn't seem to be much of a solution.
Based on what some full stack developers have posted elsewhere, a Python API handles multi-symbol EA's efficiently.
article related to similar topic, turns oscilator indicators into eas. but like the above, they will need to be modified for multi-symbol support.
https://www.mql5.com/en/articles/13244#node37
- 2024.01.16
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I wonder if in the near future we will get support for using all processor cores, or if we will continue with the single‑threaded version.
For heavy computations, such as fractals for many candles and timeframes, this takes an extremely long time.
For example, when I scan 100 companies on the stock market, on all timeframes, it takes about 20–25 minutes.
If all processor cores were used, it would be much better.