Thanks for your reply, will give it a shot.
Posts made by Breeeeen
-
RE: No Position Nearby filterposted in Questions & Answers
-
No Position Nearby filterposted in Questions & Answers
Hi everyone,
Is there a way to filter the "No Positions Nearby" block to only a certain number of positions?
To paraphrase, the "For each Position" block allows you to specify either newest to oldest (vice versa) and not more than "n" trades, can this be done for the "No Positions Nearby" block?
I did a check on the forum before posting this, but if it's been asked before then apologies for missing it! Thanks for reading


-
RE: Some of my fxd EA's won't reinitiale after changing settings or timeframesposted in General Discussions
@fxDreema as what Mantadiver was asking, is there a way we can automatically exclude this code so we don't have to jump into meta editor each time? Essentially what we want is for the EA to reinitialise when changes to any settings have been made.
-
RE: Tutorial - Create Custom Blocks with "FXDreema Studio"posted in Tutorials by Users
You're a genius, it works like a charm! Thanks for your help.
For reference if it helps others, I did it like this in the on Init tab, I can now use the .ex5 button:
-
RE: Tutorial - Create Custom Blocks with "FXDreema Studio"posted in Tutorials by Users
Hi @QuantEngineer , I'm wondering if this tutorial could help me with not having to write my enumerations each time I export a file.
Basically each time I want to export the file, I have to click the .mq5 button (not the .ex5) because of missing enumerations and then open the file in MetaEditor and add in the enumerations manually as per the picture below.

I tried adding a block using the tutorial above and adding it to the OnInit tab but every time I try clicking .ex5, I still get the same error that enumerations are missing.

Any ideas how I might use a custom block to save me the hassle of having to manually add these enumerations each time I export?
-
RE: How to set conditions on closing tradesposted in Questions & Answers
@l-andorrĂ no that money doesn't need to be customizable, just as long as profits is greater or equal to losses, whatever their values.
I tried a loop condition, what changes would you make to this example? https://fxdreema.com/shared/XVQAQMwSb (this is in MT5) -
RE: How to set conditions on closing tradesposted in Questions & Answers
Hi @l-andorrĂ , sorry the +25 and -23 were just examples, it should be any number as long as profits are equal to or greater than the losses.
-
How to set conditions on closing tradesposted in Questions & Answers
Hi everyone,
How would someone set up a situation where the EA does the following?
- Count the total dollar value of all profitable trades
- Close all profitable trades
- Start closing losing trades (biggest loss first) until the amount closed in losses equals the profits
- Skip any trades where it would make the total losses closed to be greater than profit closed
To use an example, let's say I have 3 winning trades and 4 losing trades:
Winning trades
Trade 1 buy profit $5
Trade 2 sell profit $8
Trade 3 buy profit $12Losing trades
Trade 4 buy loss $6
Trade 5 sell loss $7
Trade 6 buy loss $8
Trade 7 buy loss $9Desired outcome: close trades 1-3 (total closed profit of $25) and then close trade 7, then trade 6, skipping trade 5 (since this would make the losses go over the profit) but closing trade 4 (total closed losses of $23)?
I tried a proof of concept but it failed to do what I wanted it to (it closed everything):
https://fxdreema.com/shared/XVQAQMwSb
(This is in MT5) -
RE: OrderCheck() failed: Unsupported filling mode (10030) [possibly solved?]posted in Bug Reports
I want to say yes to both, but it's "magically" come alright since posting this (was not working for two days prior). Thanks admins I guess!
-
OrderCheck() failed: Unsupported filling mode (10030) [possibly solved?]posted in Bug Reports
Hi everyone,
My MT5 EA works perfectly for seven different currencies that I'm testing it on, but on USDCAD it gives me this error.
Looking at old threads, the admins have fixed this in the past but it pops up again from time to time.
My broker is Blackbull Markets.
Thank you.
-
RE: Check for duplicate magic numbersposted in Questions & Answers
Hi again @jstap

I suspect that may cause issues if there are existing trades and the EA is being re-initialized or was removed and subsequently re-added.After doing quite a bit of reading and thinking, I managed to implement something half-acceptable: I added a terminal variable (which changes based on group ID) and a condition to check the terminal variable.
The condition runs first, and if there is an existing terminal variable with the same value, an alert pops up (although nothing stops the EA from continuing to run). Not the most refined but it works I guess. Main trouble I find now is that terminal variable doesn't update when I change the settings on the EA. In fact, nothing on the "On Init" tab runs after changing a parameter, which was counter to my understanding of what "on init" would represent.I'll leave this topic open in case someone has a more refined solution than what I have.
Cheers. -
Check for duplicate magic numbersposted in Questions & Answers
Hi everyone,
Is there a simple way (including using custom code) to check if another EA with the same magic numbers are running on the MT4/MT5 client?
I want to use my EA with multiple charts but need to keep them separate of each other, and the easiest is to just stop it running if a duplicate magic number was detected.Appreciate any help, thanks.
-
RE: How to keep profitable trades separate from other trades? [solved]posted in Questions & Answers
Managed to figure it out, and in case anyone in the future reads this thread and is stuck at the same place as me, here's what I had to do to loop through all the groups to keep separate trades:
- Create a variable (we'll call this variable "Group ID") and use it whenever creating a new buy/sell trade or order. All order-opening related blocks need this Group ID variable. When the conditions for your EA have been met to open a new set of trades, increment this Group ID variable and open the new group with the new Group ID.
- Create a second variable (we'll call this "ID checker" variable). The purpose of this variable is to mimic the Group ID variable without interfering or changing the Group ID.
- To loop through the various groups you have, use an appropriate block (I used the "For each position") with the group mode set to "All (automated and manually opened)" and connect it to a "Modify variable" block.
- In the modify variable block, modify the ID checker variable with the group in the loop.
- Connect blocks with actions you wish the EA to perform (trailing stop loss in my case).
Picture below depicts points 3, 4 and 5.
Thanks @jstap for the discussion, talking to someone about this really helps.

-
RE: How to keep profitable trades separate from other trades? [solved]posted in Questions & Answers
Thanks @jstap, good suggestion. I'll have to do that.
Now just to figure out how to loop through the various group IDs and apply that to the trailing stop blocks...
Is there something similar to the "for each position" block for groups IDs (e.g. "for each group" loop)? -
RE: "No positions nearby" block calculating 5x bigger pip size [solved]posted in Bug Reports
@ambrogio huh is that what the "around the price" means, I read it a number of times but did not click.
(Also I've mistaken points for pips, otherwise my topic would have said 0.5x instead of 5x oops.)
That makes a lot of sense now, appreciate you looking into this. I've changed this topic to "solved" (due to user error).Thanks for your help!
-
RE: "No positions nearby" block calculating 5x bigger pip size [solved]posted in Bug Reports
Sure thing, here's a simple example I created: no constants or variables and a super simple structure to make it easy to identify.
I did a test and it's still 5x the size. -
RE: How to keep profitable trades separate from other trades? [solved]posted in Questions & Answers
Thanks @jstap yes I'm aware of this, just reluctant to have so many different magic numbers for tracking reasons.
If I were to use a group ID, how would you suggest I implement it?
I tried using variable group IDs and incrementing this number each time a condition is met (i.e. ready to open a new order), but the trailing stop loss losses track of it when that happens since it is now looking at the new Group ID.

-
How to keep profitable trades separate from other trades? [solved]posted in Questions & Answers
Hi there,
Desired outcome:
When a trade (or group of trades) becomes profitable to a certain point, the EA should activate the trailing stop loss (using the trailing start offset setting).
The trailing stop loss for this trade/trades should be independent of other trade/trades.Once the trailing stop loss is active, the EA is to create a new trade in the same direction (buy or sell); this new trade should also be independent of any existing profitable trades.
Problem to solve for:
When trades meet the trailing start offset level and begin trailing its stop loss, and the EA then opens a new trade, the trailing stop loss from the existing trades is automatically applied to the new trade even though they have not yet met the trailing start offset point.
This is likely because I am not using Group IDs.
When I try using Group IDs (variable which gets incremented whenever a new trade is opened), the EA loses track of the earlier trailing stop losses.Question for the community:
What suggestions are there to have multiple running trades all with separate trailing stop losses?If anybody has any helpful suggestions that I could try to implement, that would much appreciated.
I've included a simple mockup of my setup below.
Thanks for reading this far!(Edited to make it less complicated)
-Breeeeen -
RE: Margin Level (in %) return infinite is buggedposted in Bug Reports
@rodrigo-ortuzar I've updated the original post to make it clearer. I don't need help on solving this particular issue since I have a simple workaround, but if you're an admin, a fix would be good for future users please. Thanks.
