fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Breeeeen
    3. Posts
    B
    • Profile
    • Following 0
    • Followers 2
    • Topics 9
    • Posts 24
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by Breeeeen

    • RE: No Position Nearby filter

      Thanks for your reply, will give it a shot.

      posted in Questions & Answers
      B
      Breeeeen
    • No Position Nearby filter

      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 đŸ™‚

      320a724f-070b-4257-9c1d-1ef33ae84cb5-image.png

      posted in Questions & Answers
      B
      Breeeeen
    • RE: Some of my fxd EA's won't reinitiale after changing settings or timeframes

      @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.

      posted in General Discussions
      B
      Breeeeen
    • RE: Tutorial - Create Custom Blocks with "FXDreema Studio"

      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:

      image.png

      posted in Tutorials by Users
      B
      Breeeeen
    • RE: Tutorial - Create Custom Blocks with "FXDreema Studio"

      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.
      image.png

      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.
      image.png

      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?

      posted in Tutorials by Users
      B
      Breeeeen
    • RE: How to set conditions on closing trades

      @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)

      posted in Questions & Answers
      B
      Breeeeen
    • RE: How to set conditions on closing trades

      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.

      posted in Questions & Answers
      B
      Breeeeen
    • How to set conditions on closing trades

      Hi everyone,

      How would someone set up a situation where the EA does the following?

      1. Count the total dollar value of all profitable trades
      2. Close all profitable trades
      3. Start closing losing trades (biggest loss first) until the amount closed in losses equals the profits
      4. 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 $12

      Losing trades
      Trade 4 buy loss $6
      Trade 5 sell loss $7
      Trade 6 buy loss $8
      Trade 7 buy loss $9

      Desired 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)

      posted in Questions & Answers
      B
      Breeeeen
    • RE: OrderCheck() failed: Unsupported filling mode (10030) [possibly solved?]

      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!

      posted in Bug Reports
      B
      Breeeeen
    • OrderCheck() failed: Unsupported filling mode (10030) [possibly solved?]

      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.

      0_1649409186399_aa9a94f9-3f9e-4362-8165-16680f46444f-image.png

      posted in Bug Reports
      B
      Breeeeen
    • RE: Check for duplicate magic numbers

      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.

      posted in Questions & Answers
      B
      Breeeeen
    • Check for duplicate magic numbers

      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.

      posted in Questions & Answers
      B
      Breeeeen
    • RE: How to keep profitable trades separate from other trades? [solved]

      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:

      1. 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.
      2. 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.
      3. 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.
      4. In the modify variable block, modify the ID checker variable with the group in the loop.
      5. 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.

      0_1648518486642_3c679108-8c04-4c18-a2d9-56d739170bf2-image.png

      posted in Questions & Answers
      B
      Breeeeen
    • RE: How to keep profitable trades separate from other trades? [solved]

      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)?

      posted in Questions & Answers
      B
      Breeeeen
    • RE: "No positions nearby" block calculating 5x bigger pip size [solved]

      @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!

      posted in Bug Reports
      B
      Breeeeen
    • RE: "No positions nearby" block calculating 5x bigger pip size [solved]

      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.

      0_1648498701221_e02f1035-d7de-4aae-b21c-8532286ab703-image.png
      https://fxdreema.com/shared/EiZMUKQdc

      posted in Bug Reports
      B
      Breeeeen
    • RE: How to keep profitable trades separate from other trades? [solved]

      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.
      0_1648427574418_31df3551-87da-4d4d-9614-7a7e4c6c8a48-image.png

      posted in Questions & Answers
      B
      Breeeeen
    • How to keep profitable trades separate from other trades? [solved]

      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

      posted in Questions & Answers
      B
      Breeeeen
    • RE: Margin Level (in %) return infinite is bugged

      @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.

      posted in Bug Reports
      B
      Breeeeen
    • 1
    • 2
    • 1 / 2