Maybe you are over thinking this? The mid price of the day candle is the 50% value, so may find this the best way to work with it.

Best posts made by jstap
-
RE: Need 50% of range to create variable priceposted in Questions & Answers
-
RE: my accountposted in Questions & Answers
Click back to main page above, and ask support. If paid with crypto it can take a few days.
-
RE: Need 50% of range to create variable priceposted in Questions & Answers
Ok so the mid of the range in the day, you can use a formula block to get this:

-
RE: Need 50% of range to create variable priceposted in Questions & Answers
You can draw lines on those places like this:
https://fxdreema.com/shared/8Hr6vlcrd
-
RE: MT5 COLUMN PARAMTERSposted in Questions & Answers
You can fine the code on the MQL5 wed site, search google to find' for example AccountBalance() [Equity/Profit Etc] will return that value
-
RE: Placing Pending Orders on WRONG VALUESposted in Questions & Answers
Maybe, not the 1st time GMT time doesn't appear to work correctly. If you use meta trader code it will probably work (I use server and just change the input time to match). On mt4 GMT in backtest uses server time.
-
RE: find Candel Fullposted in Questions & Answers
Or you could use soincle candle template and minimise wick size by %

-
RE: What does the EA remember when restarting MT4/5?posted in Questions & Answers
None will, blocks that do the calculation there and then don't need to, other than that only something that saves data to a global (terminal) variable can remember.
-
RE: What does the EA remember when restarting MT4/5?posted in Questions & Answers
Or just draw the line in your EA before using, generally using the price rather than a visible object makes more sense, but these will be deleted when closing terminal/removing EA from chart, so a global variable would need to be used, you could then use this price to draw the line.
-
RE: What does the EA remember when restarting MT4/5?posted in Questions & Answers
They are not always removed, but at times I have restarted computer, loaded MT and line's etc have been missing.
-
RE: Getting few bool values from custom blockposted in Questions & Answers
Ask AI (something like chat GPT), the settings are whatever tab you are using on in this case it will be on tick, global variables are likely correct (but AI may add or remove), then there's the custom functions section, you may not need to add anything here, let AI decide, the first line in settings needs to call the custom function (if ones used by using the name (the first line) of the function, Say all this to AI, give it your code and the sections it's in, it will then advise changes, then test what it gives you, any compile errors you get on the the used project will tell you and AI where the problems lye, anything can be used in custom block code that you have change in inputs, the code just needs to reference it. GlobalVariableGet() for example will get the value from anything the custom block has set.
-
RE: MT5 Close All Fastposted in Questions & Answers
@KLG Well in mate, good to see code changed and put out for the community to use.

My bad || means or and && means and..
-
RE: MT5 Close All Fastposted in Questions & Answers
Well in keep this updated, messed about with this a long time ago, don't really have time at the minute (and was never vary good) but, in there you can add different options for the block, in this something like, limit by magic, or limit by symbol, etc, like what is in other standard FX, blocks. also
According to ChatGPT this is also used in FX custom code, but I wouldn't trust it all, some I have see used over the years of looking though. AI didn't know this when I was originally working with this code but now...
Commonly Used Tokens in FX Dreema
| | |
| ~next~ | | Refers to the next block in the execution chain
| ~prev~ | | Refers to the previous block
| ~value~ | | Used to fetch the current value of a variable or indicator
| ~custom~ | | Placeholder for user-defined values or expression
| ~time~ | | Refers to the current time or timestamp of a candle
| ~price~ | | Gets the current price (can be open, close, high, low depending on context)
| ~index~ | | Used in loops or array-like structures to refer to the current iteration index
| ~symbol~ | | Refers to the current trading symbol
| ~magic~ | | Refers to the magic number assigned to trades
| ~spread~ | | Gets the current spread valueThese tokens are often used inside blocks like:
- Modify Variables
- Condition
- Buy/Sell
- Custom Code
- Loops and Filters
๏ธ Why They're Useful- Modularity: You can reuse logic across multiple blocks without rewriting values.
- Dynamic behavior: They adapt to changing market conditions or block sequences.
- Cleaner logic: Avoids hardcoding and makes debugging easier.
If you're building session-aware or event-driven logic (like your NY session breakout detection), these tokens can help you create reusable, adaptive structures. Want to see how to use ~index~ or ~value~ in a looped candle scan or variable comparison? I can mock up a block chain or walk through a use case.
-
RE: Enum day of weekposted in Questions & Answers
Constant should be an int, and call the full function in code input:

-
RE: Enum day of weekposted in Questions & Answers
You could also create an enum and select it that way, have a good weekend:

-
RE: Problem with adding volume to buy operationsposted in Questions & Answers
Everything I said does work, add your latest link to see what you have done and what's not working
-
RE: Problem with changing internal values โโon blocksposted in Questions & Answers
I have never had this problem
-
RE: Problem with changing internal values โโon blocksposted in Questions & Answers
That's not FX, that's what terminals do, just and check values have been changed
