fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Magic Number/Separate the Different EA's

    Questions & Answers
    4
    23
    9614
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 1
      123456 Banned last edited by

      Hi,

      I want to use the same EA on multiple time frames in multiple currency pairs, at the same time.
      As an example, at any time the EA will be running on all/at once/at the same time in 12 charts:

      AUDUSD,M1 , AUDUSD,M30 , AUDUSD,H4 and AUDUSD,D1
      GBPUSD,M1 , GBPUSD,M30 , GBPUSD,H4 and GBPUSD,D1
      EURUSD,M1 , EURUSD,M30 , EURUSD,H4 and EURUSD,D1

      Totaling 12 copy of the same EA running at the same time in M1, M30, H4, and D1 for currency pairs AUDUSD, GBPUSD and EURUSD.

      __Make the used blocks input values available in MetaTrader (change the input values from MetaTrader) __

      1. The EA code/block are the same/identical for all of the EA’s. The only unique/different value for each time frame/currency pair will be the Stop Loss level (Virtual Stop Loss), Take Profit leve and the price level (I will use the ”Signals (flip-flop)” block) EA will use to open/close trades in different time frames/currency pair.

      These unique input values for each unique timeframe/currency pair are in blocks “Modify each trade” to modify the Take Profit, Stop Loss levels, "Spread Filter" block and the adjust value in the “Signals (flip-flop)” block.
      How / where can I make it so I can manually enter these variables for each EA before placing the EA in the chart ? So I don’t have to make 12 copies of the same EA all hard wired with separate values for these two blocks only.

      **Magic Number / Separate the Different EA's **

      1. Make so that each EA operates only within its own chart. The EA only closes/monitors trades in its own chart (time frame /currency pair) and does not interfere with other EA’s trades ? I think it is called Magic Number.
      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        The best way is to create some Constants (you can see Constants on the right side) and use them inside blocks. These are basically "extern" MQL4 variables. See here: http://fxdreema.com/documentation/proje ... 0variables

        Magic number is attribute of every trade/order, and the idea is that different EAs can share the same pool with trades and orders without interfere each other.
        Every EA created with fxdreema has at least one input parameter called MagicStart, which is magic basically number. More here: http://fxdreema.com/documentation/proje ... d%20groups

        Very nice view of the question by the way 🙂

        1 Reply Last reply Reply Quote 0
        • 1
          123456 Banned last edited by

          __The best way is to create some Constants (you can see Constants on the right side) and use them inside blocks. These are basically "extern" MQL4 variables. See here: http://fxdreema.com/documentation/proje ... 0variables

          Magic number is attribute of every trade/order, and the idea is that different EAs can share the same pool with trades and orders without interfere each other.
          Every EA created with fxdreema has at least one input parameter called MagicStart, which is magic basically number. More here: http://fxdreema.com/documentation/proje ... d%20groups

          Very nice view of the question by the way :)[/quote:4bh9eof8]

          Hi,

          Is this understanding correct:

          • Group# , separates the different orders/blocks within the EA. Or even between different EA's if unique/not duplicated values are used in each EA ?

          • Magic Start , separate the different EA's from each other, even if they all use the same Group# numbers. It is unique to the project, provided not deliberately duplicated in other EA ?

          My question is:
          Can I set the project Magic Start number to be a constant, referring to your reply ? This way I can give each EA a unique Magic Start number from Metatrader (asuming the 'Constant's' values can be set/changed from Metatrader) ?

          Few more unrelated questions:

          • On Fx Dreema Desktop version, in which folder is the EA saved ? Can I decide/set the folder where the EA file will be saved ? I cant find the EA and I only get the message "Check if Metatrader 4 directory is correctly set". Where is the EA file ending up ?

          • How do I export my project as MT5 file ? I can only see export as .mq4 and .ex4 on the top left corner ? Or is it enough to selct MQL5 as code language, and where can I change again/back to MQL4/MQL5 file type ?

          • Is it possible/available to use Virtual Stop in MT5 ?

          • For the block "Chart Screenshot", which folder/where will the screenshots be saved ? Is it possible to send the screenshots to my email (for every opened and closed trade) ?

          • How can I make the EA trade only in the period one hour after the market opens and close all open trades one hour before the market closes ? (starts Sunday 6 pm EST (11:00 pm GMT), closes on Friday 6 pm EST (21:00 pm GMT) and only trades during this time ? Like here http://fxdreema.com/forum/viewtopic.php?f=2&t=1873. But how do I setup and input these blocks ??

          • How do I close all open trades at the end of the bar ? So that all open trades are closed when a new bar begins/start/form ?

          • Once an X-Pip profitable sell/buy trade[s] has occurred/accumulated, I would like to disable new/further sell/buy trades until a new bar starts. How do I set this up with?

          • When it comes to protecting the EA code (in case of the theft of my computer, or the EA is stolen from my PC by an hacker, or to protect the EA from my broker if using the brokers VPS service), do you have any measures to protect the EA code/ prevent EA decompiling ?

            Thank you for your wonderful help, and the wonderful EA creator.

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            For MT4 only Magic Number exists and as I said, this is attribute of the trade/order. When all trades and orders exists in one single pool, if there are 2 or more EAs, each of them must recognize it's own trades/orders. Magic number is the color of the shirts of soccer players.
            Within the EA we can use more than one magic number. Again, this is only attribute to the trade/order that is once set when it is created, and when needed we can load that trade/order and ask for it's magic number. So, within the EA: MagicNumber = MagicStart+GroupNumber

            "MagicStart" is already included as input parameter.

            If you have disabled Windows UAC, the output file is written under "/experts" subfolder for MT4 and everything should be ok. But don't include "/experts" part to the settings in fxDreema. With Windows UAC enabled, many strange things happens 😕

            MT4 and MT5 projects are separated, you choose the platform when creating a new one. The reason is that MT4 and MT5 are logically different - MT5 can only have single position per symbol, and this can make the whole strategy different. Also, there are other smaller differences and because of that they are totally separated.

            Virtual stops in MT5... I have to write some code for this, at the moment it's only for MT4.

            Screenshots are saved... It depends on what you do - backtest or demo/real. I think under "/files" folder, but you better search for the files and you will find them.

            You can try "Time filter" block, this was the last one I created in this category. All the others are pretty old and maybe I need to replace them with...

            End of the bar again... I should create an event system for that. At the moment it's better to do things on the new bar creation ("Once per bar" block at top level), because end bar detection is not as easy as it sounds like.

            For X-pip question - "Once per bar" block.

            No protection service is available here. Take a look at this website: https://mqllock.com/

            1 Reply Last reply Reply Quote 0
            • T
              trendking last edited by

              Hi,

              Thank you for your reply.
              I have now opened a live account, this one.

              I have a problem with this setup; Buy now when the Bid price move 2.5 pips above candle open price.
              I use the "Signal flip-flop" block and "Buy now" block only.
              Shared link http://fxdreema.com/shared/rgOIaTCPc
              When I try to make .ex5 file, I get error 'Dynamic lots function not defined' (9 lines of them). But I am using fix lots and not dynamic lots ?

              Many thanks.

              1 Reply Last reply Reply Quote 0
              • fxDreema
                fxDreema last edited by

                I didn't noticed that error... thanks for reporting it!

                By the way, the right operand in Signals block returns value like 1.3028, and after you add 2.5 to it, it will become 3,8028. You can use +0.00025 instead 🙂

                1 Reply Last reply Reply Quote 0
                • T
                  trendking last edited by

                  Hi,

                  Thank you.

                  The .ex4 file looks to work fine in MT4. Link to share project: http://fxdreema.com/shared/IKyKF6noe
                  But the .ex5 file takes two-to-five trades in strategy tester and then crash/stops. I tried on two different MT5 strategy tester accounts. Link to share project: http://fxdreema.com/shared/rd12YaRBd
                  I use 0.00001 point format on both .ex4 and .ex5, with identical block/settings.

                  Can you please help me identify why the .ex5 version is not working correctly ?

                  Thank you.

                  1 Reply Last reply Reply Quote 0
                  • fxDreema
                    fxDreema last edited by

                    "Signals" block works like this: when the condition inside is true, it outputs once and waits for the opposite condition to become true (and outputs once from the yellow output). Then, it starts again.
                    The condition you entered obviously makes it to work very often, so there are too many trades opened.

                    There is no single open condition that can be used, you must know when you want to enter in trade and when to allow it to trade again. Use "No trade is running" if you don't want to enter in new trade until the current one exists. Or "Once per bar" to limit trades in time. Or some of the time filters.

                    1 Reply Last reply Reply Quote 0
                    • T
                      trendking last edited by

                      Hi,

                      I placed "No position running" block and use the yellow output signal,
                      Shared project link http://fxdreema.com/shared/V2Sl5Fzcb
                      But I get the error text in the attached picture.

                      ......
                      error text.JPG

                      1 Reply Last reply Reply Quote 0
                      • fxDreema
                        fxDreema last edited by

                        oops...

                        1 Reply Last reply Reply Quote 0
                        • T
                          trendking last edited by

                          Hi,

                          I looked at the .ex4 MT4 file in the strategy tester (demo account) again .
                          Link to the shared project: http://fxdreema.com/shared/QjLQiBmwc

                          The .ex4 does not give error code when compiling like the MT5 version (my previous post).
                          But the .ex4 EA does not open/execute trades correct.
                          It opens one trade during the entire strategy test.

                          1 Reply Last reply Reply Quote 0
                          • fxDreema
                            fxDreema last edited by

                            Ah, yes, I forgot to tell you this... It's a good idea to take a look at your Journal (Experts) tab from time to time. In this project you tell the EA to put SL like 0.00002 and TP like 0.00001. In pips, this is 0.2 and 0.1 pips, and it's too small.
                            In fxDreema, with 0.00001 format, 1 pips in blocks is equal to 0.00001.

                            I think it's easier in 0.0001 format 🙂

                            1 Reply Last reply Reply Quote 0
                            • T
                              trendking last edited by

                              Hi,

                              I tried 0.0001 point format with 2 pip as TP/SL.
                              And 0.00001 point format with 20 pip as TP/SL.
                              Either way the .ex5 EA opens only one or two trades during the whole EA strategy test.
                              Shared project link : http://fxdreema.com/shared/QnWqRP4Bb
                              It has no effect.

                              (My ECN broker uses 0.00001 point format, any conflict if I use 0.0001 point format in the EA? )

                              1 Reply Last reply Reply Quote 0
                              • fxDreema
                                fxDreema last edited by

                                fxDreema does not care what point the broker uses. This point format (in project settings) is the one you want to work with, not the one the broker uses. Using "0.0001" means that the EA will work in this format in any broker, no matter if it is "0.0001" or "0.00001".

                                Do you have errors? Because I have errors when using 2 pips (0.0002), obviously my broker has some limits to the size of SL and TP. But when I put 5 pips, there are soo many positions out there (it's working).

                                1 Reply Last reply Reply Quote 0
                                • T
                                  trendking last edited by

                                  Hi,

                                  I get " Failed Modify buy [Invalid stops] " in the Strategy Tester Journal (demo account).
                                  I use the attached MT4/MT5 demo accounts strategy testing.

                                  ......
                                  New Folder.rar

                                  1 Reply Last reply Reply Quote 0
                                  • fxDreema
                                    fxDreema last edited by

                                    Well, you can try with bigger SL and TP to see when you will be able to put it. Try with 3, 4, 5 pips...
                                    Unfortunately this is something that does not depends on the EA. The error comes because the EA tries to put it at close levels, but it's impossibe due to broker limits.

                                    1 Reply Last reply Reply Quote 0
                                    • T
                                      trendking last edited by

                                      Hi,

                                      I tried 13 pip TP/SL. (point format 0.0001).
                                      It still opens only 2 trade during the strategy test, with Invalis stopp error still there.
                                      So 13 pip TP/SL had no effect. Try and see , shared project http://fxdreema.com/shared/iQKCxjzJb.

                                      1 Reply Last reply Reply Quote 0
                                      • fxDreema
                                        fxDreema last edited by

                                        Ahaaa, then can you see what happens in Inputs tab?

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          trendking last edited by

                                          I dont understand ??
                                          I am not sure which block is not the fault, so I am trying to attach a draw Arow to the Signal flip-flop and run on strategy tester.
                                          And then run Buy now with some MA or MACD with same ST/TP to see if it is the reason.
                                          identify block that is cause.

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post

                                          Online Users

                                          W
                                          S
                                          A
                                          H
                                          H
                                          T
                                          S

                                          16
                                          Online

                                          146.7k
                                          Users

                                          22.4k
                                          Topics

                                          122.6k
                                          Posts

                                          Powered by NodeBB Forums | Contributors