try saving and reading as a terminal (global) variable.
Best posts made by jstap
-
RE: Problem with changing internal values on blocksposted in Questions & Answers
-
RE: Problem with changing internal values on blocksposted in Questions & Answers
global variables are stored in a folder separate to where your local variables are, so they will not change until you change them, so if a block is reading them to use, it will be the same untill you change.
-
RE: help two indicatorposted in Questions & Answers
Just ask AI:
Quick Answer:
The Average Directional Index (ADX) and the Average Directional Movement Index (ADX Wilder) are essentially the same indicator conceptually, both created by J. Welles Wilder Jr. in 1978. The difference lies in calculation methods used by trading platforms: Wilder’s original formula uses his own smoothing technique (Wilder’s Moving Average), while some modern platforms implement ADX using standard moving averages (like EMA or SMA).
Core Concept- Inventor: J. Welles Wilder Jr. introduced the Directional Movement System in his book New Concepts in Technical Trading Systems (1978).
- Components:
- +DI (Positive Directional Indicator) → measures upward movement.
- –DI (Negative Directional Indicator) → measures downward movement.
- ADX (Average Directional Index) → measures trend strength, regardless of direction.
-
RE: Horizontal lines are not stopingposted in Questions & Answers
as i said and showed in my picture under the if trade will stop all blocks below running... how is that supposed to do anything if no trade is placed...when testing how things work the less used blocks the better...if this is just part of a larger project say what this is doing and why
-
RE: Calculate the sum of profitsposted in Questions & Answers
modify a variable to 0 - for each trade/position - check profit (>0) - formula block (add in loop trade profit)
-
RE: Calculate the sum of profitsposted in Questions & Answers
Yes but no because you didn't set the variable to 0 before starting the loop:

-
RE: Problem with adding volume to buy operationsposted in Questions & Answers
Both look the same so should work the same, try recreating the project from scratch, shouldn't make a difference, but worth a try. Create constantl as picture, then you can select number in multiple blocks, this will show up in your inputs, reducing how much you have to change:

-
RE: fxDreema based copierposted in Questions & Answers
This should work but the open price variable should be a string (a name you want to call the global variable), same name for sender and receiver. Value you are sending/receiving is stored in the global variable, not a local one, though you could send/receive local variable data, but it will be sent to the global
-
RE: Expiredposted in Questions & Answers
You can add a shared link to look at, but it should still work anyway.
-
RE: No Position Nearby filterposted in Questions & Answers
This will probably do it, under the condition is where you would do something like place a trade.
https://fxdreema.com/shared/gsxiiKgZc -
RE: Indicators Used by the EA doesn't show on the Chartposted in Questions & Answers
No that you save and call every time you need to update, generally they will be remembered every time you restart the terminal. name a template the same as the EA and on backtest template will load.
-
RE: What is your opinion on this backtest?posted in Questions & Answers
I asked ChatGPT to translate and asses. On a personal note, Gold is generally bullish, so maybe cut sells entirely, but seems to work, now set it on demo and painfully watch to check account results are same as backtest (probably will be as your stops are sensible).
Here’s the full translation of the trading report from Portuguese to English:
Trading Report Summary- History Quality: 100%
- Bars: 5,569
- Ticks: 63,291,871
- Assets: 1
Account Performance- Initial Deposit: 10,000.00
- Total Net Profit: 1,187.23
- Gross Profit: 3,956.13
- Gross Loss: -2,768.90
Drawdown Metrics
Balance Drawdown:- Absolute: 0.00
- Maximum: 220.86 (1.97%)
- Relative: 1.99% (220.86)
Equity Drawdown: - Absolute: 21.24
- Maximum: 274.28 (2.44%)
- Relative: 2.44% (274.28)
Risk & Return Indicators- Profit Factor: 1.43
- Recovery Factor: 4.33
- AHPR (Average Holding Period Return): 1.0008 (0.08%)
- GHPR (Geometric Holding Period Return): 1.0008 (0.08%)
- Expected Payoff: 8.24
- Sharpe Ratio: 2.53
- Linear Regression Correlation: 0.94
- Linear Regression Standard Error: 94.73
- Margin Level: 12,072,000.00%
- Z-Score: 1.13 (73.73%)
- OnTester Result: 0
Trade Statistics- Total Trades: 144
- Total Orders: 288
Trade Breakdown: - Sell Positions (win rate): 56 (62.50%)
- Buy Positions (win rate): 88 (71.59%)
- Profitable Trades (% of total): 98 (68.06%)
- Losing Trades (% of total): 46 (31.94%)
Trade Outcomes- Largest Profit per Trade: 85.22
- Largest Loss per Trade: -61.67
- Average Profit per Trade: 40.37
- Average Loss per Trade: -60.19
Strengths
• Net Profit: £1,187.23 on a £10,000 deposit is a solid 11.87% return.
• Profit Factor (1.43): Indicates the strategy earns £1.43 for every £1 lost—respectable, though not elite.
• Sharpe Ratio (2.53): Excellent. Suggests strong risk-adjusted returns.
• Drawdown Control:
• Max equity drawdown: 2.44%—very low, showing tight risk management.
• Max balance drawdown: 1.97%—also minimal.
• Trade Consistency:
• 68% win rate overall
• Buy trades win 71.59%, sell trades 62.5%—suggests directional bias is well-handled.
• Recovery Factor (4.33): Shows resilience after losses.
️ Weaknesses or Areas to Watch
• Average Loss (-60.19) vs. Average Win (40.37):
You're losing more per losing trade than you're gaining per winner. This could be a red flag unless the win rate compensates—which it mostly does here.
• Largest Loss (-61.67) vs. Largest Win (85.22):
Not extreme, but worth monitoring. If losses spike, it could erode the edge.
• Z-Score (1.13, 73.73% confidence):
Indicates some statistical edge, but not overwhelming. Could be improved with more trade data or tighter entry logic.🧠 Strategic Takeaways
- This strategy is stable and scalable. The low drawdowns and high Sharpe ratio suggest it could handle larger capital without breaking.
- Risk-reward ratio needs tuning. If you can reduce average loss or increase average win—even slightly—you’ll compound gains faster.
- Directional bias is working. Long trades outperform shorts. You might consider optimizing short entries or even filtering them out if they’re dragging performance.
Want help visualizing the equity curve or comparing this to another strategy? I can chart it out or run a deeper analysis.
Streaks- Max Consecutive Wins ($): 8 trades (320.08)
- Max Consecutive Losses ($): 3 trades (-180.16)
- Max Consecutive Profit (count): 320.08 (8)
- Max Consecutive Loss (count): -180.16 (3)
- Average Winning Streak: 3
- Average Losing Streak: 1
-
RE: Trail only After 1Rposted in Questions & Answers
@ellemitless Not sure exactly what you want, but if you use the stoploss as the trail start, then trail won't start until price is as far away as the stop is
-
RE: Trailing stop at running tradeposted in Questions & Answers
It is not easy to trail by money, is easier to trail by pips
-
RE: how to create a variable for fibonacci levels so thati can optimize my ea?posted in Questions & Answers
This should do it, use this wherever you currently use the FIB block, the custom code can go anywhere just make sure it is connected to another block, or under a pass. you can then optimise each constant leaving the variable with the different levels each pass:
https://fxdreema.com/shared/fmwHC8Pid -
RE: Backtest consump too massive storageposted in Questions & Answers
Ok, then that says it is the MT5 that's doing it, what I put above will allow you to delete some so you can download different.
-
RE: Trouble of constants for My Indicators' input optionsposted in Questions & Answers
You can not create a enum for this as it is already pre defined, ENUM_MA_METHOD is the correct type, MODE_EMA is the correct value:
https//www.mql5.com/en/docs/constants/indicatorconstants/enum_ma_method
-
RE: Count Days.posted in Questions & Answers
For this expiry date you need to get it from the broker, there is no MetaTrader code that can get this. Once you have it you can make the automatically trade end so you are not committed to buy it.
-
RE: Can you help me with this martingale?posted in Questions & Answers
I would do it more like this, so it resets back to the original value when there is 0 trades, is a simple continual way but would need more conditions added: https://fxdreema.com/shared/FxWncGSqc
-
RE: wait 16 minutesposted in Questions & Answers
I find the easiest way is to constantly add 1 every minute to a variable, variable to 0 on event (like candle opening), check the value and when it reaches 16 commit to do something.