fxDreema

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

    Help To Build My EA

    Questions & Answers
    2
    3
    944
    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.
    • B
      barkahsaptadi last edited by

      I need to buy and sell in the same time with this rule (in 1 EA) :

      A. SELL RULE (with no pending order) :

      1. Buy 1 Size:0,01 => TP:4
      2. Buy 2 Size:0,02 => will execute after dropping 11 pips from Buy 1 => modified All Buy TP to 7.9 pips from OP buy 2
      3. Buy 3 Size:0,03 => will execute after dropping 11 pips from Buy 2 => modified All Buy TP to 11.8 pips from OP buy 3
      4. Buy 4 Size:0,05 => will execute after dropping 11 pips from Buy 3 => modified All Buy TP to 14.2 pips from OP buy 4
      5. Buy 5 Size:0,08 => will execute after dropping 11 pips from Buy 4 => modified All Buy TP to 17.9 pips from OP buy 5
      6. Buy 6 Size:0,13 => will execute after dropping 17 pips from Buy 5 => modified All Buy TP to 21.6 pips from OP buy 6
      7. Buy 7 Size:0,22 => will execute after dropping 17 pips from Buy 6 => modified All Buy TP to 26.3 pips from OP buy 7
      8. Buy 8 Size:0,38 => will execute after dropping 17 pips from Buy 7 => modified All Buy TP to 29 pips from OP buy 8
      9. Sell A Size : 0,8 TP:30 => at the same price with buy 8

      If TP All Buy Reach or TP Sell A Reach, this BUY RULE close and start again.

      B. SELL RULE (with no pending order) :

      1. Sell 1 Size:0,01 => TP:4 (Sell Now)
      2. Sell 2 Size:0,02 => will execute after rising 11 pips from Sell 1 => modified All Sell TP to 7.9 pips from OP Sell 2
      3. Sell 3 Size:0,03 => will execute after rising 11 pips from Sell 2 => modified All Sell TP to 11.8 pips from OP Sell 3
      4. Sell 4 Size:0,05 => will execute after rising 11 pips from Sell 3 => modified All Sell TP to 14.2 pips from OP Sell 4
      5. Sell 5 Size:0,08 => will execute after rising 11 pips from Sell 4 => modified All Sell TP to 17.9 pips from OP Sell 5
      6. Sell 6 Size:0,13 => will execute after rising 17 pips from Sell 5 => modified All Sell TP to 21.6 pips from OP Sell 6
      7. Sell 7 Size:0,22 => will execute after rising 17 pips from Sell 6 => modified All Sell TP to 26.3 pips from OP Sell 7
      8. Sell 8 Size:0,38 => will execute after rising 17 pips from Sell 7 => modified All Sell TP to 29 pips from OP Sell 8
      9. Buy B Size : 0,8 TP:30 => at the same price with Sell 8

      If TP All Sell Reach or TP Buy B Reach, this SELL RULE close and start again.

      Please Help me.... I lost my brain after try this for 5 days...

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

        I saw your current project and you are following the same mistake that many people does - connecting everything in a row, hoping that events will happen that way. But this is not a web script that (execute once and forget), this is a program that works in time.

        And when a program works in time, it works on an events principle. There is a main cycle that repeats everything again and again and again... In desktop programs there are many hidden cycles everywhere. For a program, just to detect that you clicked on a button, the program loops into infinite cycle asking "clicked? clicked? clicked? clicked?...". This happens with high frequency, but you cannot see it.

        In MetaTrader there is no need to ask for something with high frequency, it's enough for that to happen on every new tick, because ticks are causing changes. So when you look at the top of fxDreema, you will see one orange button called "on Tick". Which basically means that everything below it is executed on every tick. It's not just "run and forget". The blocks itself are not designed to enter in their own independent cycles, and there is no need to do that.
        This is the case with EAs. Scripts are "execute once and forget", but I don't think you are trying to make a script.

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

          For the system above. Is there some formula behind those numbers or they are imagined by you? If lot sizes, dropping pips and TP pips are totally custom, the whole thing will take many blocks, but if there is a formula behind those numbers, it can be done with minimum blocks (and better control).
          Why 7.9 pips, not 8 pips? There must be something behind that...

          In any case, there are two blocks to put multiple pending orders at once with different parameters. Their lot sizes, distance from each other, SL and TP can be non-linear, so this is maybe the best and easiest approach to do everything. At least to see if everything works. What is also good in pending orders is that they work automatically on the server.
          Maybe the reason why you want to not use pending orders is that you don't want your broker to see how your EA works. Maybe I should also create virtual pending orders system. But in fact, I think that the broker, if he wants to, can cause much more damage on your trades.

          For example, these days a friend of mine losed tousands of dollars because of 5-minutes problems with the server. The EA was confused of what to do. But if something wrong happens on your EA... well, from the broker's point, this is your fault. But if the whole system is located in their server in form of pending orders and if something went wrong - this is clearly their fault. Each pending order is like a micro-EA working on their server.

          So, can you imagine the system described above with pending orders?

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

          Online Users

          T
          T
          Q
          A
          M

          11
          Online

          146.8k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors