modify variable to 0 - for each trade/position (buys or sells) - add 1 to a variable with a formula block. This should constantly check if any trades are running, if not reset variable to 0
Best posts made by jstap
-
RE: is this a bug? or what? on counting open buyposted in Questions & Answers
-
RE: Trade statistics: Profit Factorposted in Questions & Answers
Good question but, it is likely the account
-
RE: how I can identify the candlestick with the highest volume during the dayposted in Questions & Answers
You can create this with FX blocks. but sometimes custom code works better and is easier, this will draw a line on previous day volume high candle, you can choose hour TF or current chart TF. Test on backtest, it is MT4 if you need MT5 and you struggle let me know: https://fxdreema.com/shared/XYlynIK4

-
RE: Slippageposted in Questions & Answers
Most forex pairs are converted with the project options, anything else will be points still, if you drag your cross hair over the terminal screen, you will get the points value to use.
-
RE: Custome indicator ORDERBLOCKposted in Questions & Answers
You can manually add indicators as you have done, spellings and order need to be correct. But 1st ensure in your terminal data window, there are buffers showing that has data you can access and use.
-
RE: HOPW TO OPEN ONLY ONE POSITION FOR EACH CROSS ?posted in Questions & Answers
Set up a test project you can watch visibly on backtest, use pass once blocks, switch on/off evert time a cross happens...
-
RE: Identifying Levelsposted in Questions & Answers
when this happens save the price in a variable, then use that variable as the new trade stop.
-
RE: Martingale for both buys and sells?posted in Questions & Answers
To do this you will need to set up manually, something like this, on trade tab - trade closed by (sl/tp whatever works for you) - conditions for placing a trade - for each closed trade/position buy/sell using the last trade lot from a loop adjusted to however you want the new lot to be.
-
RE: HOW TO PUT THE HH:MM IN A VARIABLE TO OPTIMIZE THE BEST WORKING TIME OF THE DAY?posted in Questions & Answers
Use components to optimise, and convert them to a string to use in blocks like time filter.
MT4: https://fxdreema.com/shared/IbgvGjJY
MT5: https://fxdreema.com/shared/VpOj39mrc -
RE: Orhpaned constants when running EAposted in Questions & Answers
@jstap Good mate, glad you sorted it. I said that first...
"Magic no is always there, the rest are created by boxes you have ticked in a block or two". -
RE: Orhpaned constants when running EAposted in Questions & Answers
Magic no is always there, the rest are created by boxes you have ticked in a block or two.
-
RE: Where are comments printed now?posted in Questions & Answers
Does this help? From Copilot (chatGPT)...
It sounds like your friend’s custom MT5 code used to reliably write to the log file via Print(), but after a recent update, the log location may have changed or the behavior of logging might have shifted slightly.
Here’s how to track down the new log file location and ensure the output is still being captured:
Where MT5 Stores Log Files Now
There are two main types of logs in MT5:- Platform Logs
- These are stored in:
...\MetaTrader 5\Logs\ - They capture general platform activity, including terminal startup, network events, and trade operations.
- Expert Logs (EA/Script Output like Print())
- These are stored in:
...\MetaTrader 5\MQL5\Logs\ - This is where your Print(cmt); output should appear.
To locate them: - Open MT5.
- Go to File → Open Data Folder.
- Navigate to:
- MQL5\Logs for EA/script logs.
- Logs for platform logs.
Each log file is named by date: YYYYMMDD.log.
️ If Nothing Is Showing Up
If your friend’s Print() output isn’t appearing: - Check the Experts tab in the MT5 terminal (bottom panel). If the EA is running, output should appear there live.
- Make sure the EA is attached and running—if it’s not triggered, no logs will be written.
- Confirm that logging is enabled in MT5 settings (some updates may reset preferences).
- If the EA is compiled in Release mode, some debug output might be suppressed. Try compiling in Debug mode.
If your friend wants to make the output more persistent or structured, I can help them write to a custom file using FileOpen() and FileWrite() instead of relying solely on Print(). Want to go that route?
-
RE: Check Distance Price Fractionposted in Questions & Answers
depends on traded asset and pip rules set in settings.
-
RE: Blocks for "bidding price"posted in Questions & Answers
Trailing stop is the easiest way to achieve this, in the block using a separate tree to the one placing the trade, you can set start in pips from open price so stop doesn't move until price goes in the right direction. Stop is how for behind current price the stop should be, if price retraces the stop will stay in place until it's hit. Step is how often stop should move.
-
RE: Buy only Sell only MT5posted in Questions & Answers
They are numeric, because although text is a string, it counts the tecx as a position (buy=0 sell=1, both=2) All I know is this compiled for me, it is tried and tested. Basically check if the enum text is what is selected in the inputs, if so activate blocks below, if not go through yellow and check the next. this https://fxdreema.com/shared/m27SSDMZd you can run on MT5 back test, and see that every time you change a input the drawn text will change.
