The variable type is set in FX, sting = text, double = 0.0, int = 0, bool = true/false, date time is similar to int, you can search google for these definitions. The bool constant is checked in the condition, then it sets true of false to the string variable, " " tells the block you are setting text instead of a numeric number. true = 1 false = 0
Best posts made by jstap
-
RE: Important questionposted in Questions & Answers
-
RE: How can a file be created on back testing?posted in Questions & Answers
You can write in backtest, try this: https://fxdreema.com/shared/mSTWWc6Cb
file should be created here: <terminal_data_folder>/Tester/files/test_output.csv
-
RE: daily profitposted in Questions & Answers
Above trade tree - check (period of time) < x.xx. In a separate tree, above close block - check (period of time) > x.xx.
-
RE: Logic (true-false) block not behaving as I expectedposted in Questions & Answers
You have nothing setting that flag, default will be false, meaning this is the only option that will create a trade.
-
RE: what is the difference between close and close psitions blocks/posted in Questions & Answers
Close (pink) will only work correctly under a for each, the for each selects in a loop the trade/trades to close. Close positions will close all selected (this will us a loop, but is internal)
-
RE: WHY OPTIMIZATION IS SO SLOW WHEN I USE "ON TRADE" BLOCKS ?posted in Questions & Answers
Under your buy or sell block - modify variable to 0 - for each closed trade (set up as you want) - formula + trade profit and save into the variable you just set to 0.
-
RE: Problem generating Oninit code?posted in Questions & Answers
No mate, only the Amazon version, you can get the app to view it on the ipad.
-
RE: And Blockposted in Questions & Answers
bool is simply true/false, so i9t either pass es on to next or not, without seeing inside blocks your conditions may be the bigger problem, once per bar above means it fires first requiring the condition to be true at that point in time, once per bar is generally better under the conditions. The and block is pointless in this case, because condition on top of condition on top of condition without the and means 3 conditions have to be true to work. The and block is expecting the 3 above blocks to be true at the same time, but if the bool is false then only 2 can be, if you connect the yellow bool dot to the and block then the 3rd condition will be skipped and and will work of 2 conditions.
-
RE: Indicator Buffer dataposted in Questions & Answers
mq is a lot easier as all buffers are already in the file, ex works but can be difficult. input all input parameters (I make sure all names are identical, just to eliminate a possible problem), then check if the indicator has relevant buffers, load to your MT terminal and view your data window, this will show you the available buffers, they be be in an order starting with 0, the value shown is what FX can retrieve, put in the buffer list on FX all the relevant buffers, call them what you want. Once loaded onto FX you should see all the indicator can do and the buffers in the my indicators section.
-
RE: heikin ashi bear to bull find low sizeposted in Questions & Answers
You'll have to say if it does/doesn't, not recently I have tried to use HA this way, but didn't show the right candle, why I used ChatGPT and it said:
Why the lines appear on the wrong candle
Your logic is correct, but the visual mismatch happens because of how MT4 handles:- Heikin‑Ashi indexing
- Shift timing
- Bar completion
- Redrawing on every tick
Two things cause the lines to appear on the 3rd candle instead of the 1st:
- Heikin‑Ashi is not aligned with the chart candles
You’re drawing lines on the real chart, but your logic is detecting HA candles, which do not line up 1:1 with the visible candles.
So:
- HA shift 1 ≠ real chart shift 1
- HA shift 2 ≠ real chart shift 2
This alone can move your line forward by 1–2 candles.
- Your code uses Time[1], but the HA candle you detected may actually correspond to Time[2] or Time[3]
Because HA candles are synthetic, the “bullish HA candle at shift 1” might visually appear on the chart two candles later.
So the line is drawn correctly according to your logic, but not where your eyes expect it.
so good luck relying on the standard blocks... as in your picture above it looks like this is the problem you are facing.
-
RE: Problem generating Oninit code?posted in Questions & Answers
Ask AI:
Looking at the code, I can spot a few issues:
- static variable won't work in a Custom Block
static ulong last_logged_deal = 0; — Static variables inside FXDreema custom blocks don't persist between calls the way they would in a native MQL5 function. This means last_logged_deal will reset every tick, so the duplicate-deal guard will never actually work.
Fix: Use a Global Variable instead:
mql5ulong last_logged_deal = (ulong)GlobalVariableGet("LastLoggedDeal");
And after updating it:
mql5GlobalVariableSet("LastLoggedDeal", (double)deal_ticket); - No HistorySelect call before accessing history
HistoryDealsTotal() and HistoryDealGetTicket() require history to be loaded first. Without this, you may get 0 deals even when history exists.
Fix: Add before your history calls:
mql5HistorySelect(0, TimeCurrent()); - Missing CSV header row
The file is opened in append mode (SEEK_END) every time, so there's no header written. This makes the CSV harder to work with in Excel etc. You'd want to check if the file is new/empty and conditionally write a header row first. - _Digits used for spread
Spread is typically displayed as points, not price digits. Using _Digits gives you a raw price difference like 0.00010 rather than the more readable 1.0 (in points). Consider:
mql5DoubleToString(spread / SymbolInfoDouble(symbol, SYMBOL_POINT), 1) - FILE_SHARE_WRITE without FILE_SHARE_READ
If anything else tries to read the file while it's open, it'll be blocked. Adding FILE_SHARE_READ is safer:
mql5FILE_READ|FILE_WRITE|FILE_CSV|FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_COMMON
The most critical of these is #2 (missing HistorySelect) and #1 (the static variable not persisting) — both could cause the logger to silently log nothing or log duplicates.
- static variable won't work in a Custom Block
-
RE: About the Chrome extension to download filesposted in Questions & Answers
Start a new question for this, only ex files created on FX can be used (except indicators, they can be used in a FX EA)
-
RE: Problem generating Oninit code?posted in Questions & Answers
Yes (possibly) you could generate a custom block, but this gets quite difficult, but if you understand how you may manage it, the easiest way is to ask AI a few questions, on trade may go into here, in here you will see how the sections work, for this I think you need to treat the setting section as on trade which is where you would use the block, ask ai what code should go in what section. Save and use the block in a project, any errors that come up will be from what is written in "create custom blocks, keep changing/saving/refreshing project.
-
RE: Re-open trade at Double the lot size after stop loss is hitposted in Questions & Answers
trade signal - (pink) for each closed trade - buy/sell (lot selected in a loop adjusted to *2)
-
RE: Re-open trade at Double the lot size after stop loss is hitposted in Questions & Answers
This is only buys and is done on the on trade tab to separate the first trade from multiply lot trade.

-
RE: Does anyone know how to check distance between current price and the ema line?posted in Questions & Answers
Like the picture, in the condition choose a to reset (to stop multiple notifications):

-
RE: Does anyone know how to check distance between current price and the ema line?posted in Questions & Answers
Yes and more, the best way to work things out even when you have what to do, is put the values in a comment, or draw objects to show what is visibly happening in backtest, you can then use this to check what you want/think is happening... You can try this, connect off yellow what to do when distance is true:

-
RE: Profit per session then stopposted in Questions & Answers
Try this, be careful GMT is actually reading GMT time, I have set (period of time) +2 as this block doesn't use GMT, set to your server offset, the only way to stop trading is to put a block in that prevents it.

-
RE: How to keep a fixed reference balance per trade in FxDreema (multi-EA issue)posted in Questions & Answers
This should do it, there is code on two tabs: https://fxdreema.com/shared/UPExIp7D
-
RE: One Trade Cycle Per Candle (No Re-Entry After TP/SL in Same Candle)posted in Questions & Answers
On tick tab your logic allows the trades put this under a flag - on trade tab trade closed set the flag (so no more trades can be placed) - on tick once per bar (reset the flag (so trades can be placed).