fxDreema

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

    EA for example

    Questions & Answers
    2
    4
    829
    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.
    • D
      dani17 last edited by

      hello,

      I want scalper EA but just do not succeed when to define it when the trigger signal is triggered example tp 5 pips.
      entry is correct but when reaches TP then immediately open trade with same conditions.

      All the profit that makes it immediately loses because it buys in overbought

      pleasse help me

      thank you

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

        You have limited trades by count, so you can't have 2 or more trades at the same time. But nothing limits the creation of trades in time, because your condition RSI > 50 is true probably half of the time while the EA is working. You also use Time filter, which is also true for all ticks between 8:00 and 12:00.

        I don't know how exactly you want to limit the number of trades in the time, but try with "Once per bar" block. It matters where it is placed - before the condition or after.

        1 Reply Last reply Reply Quote 0
        • D
          dani17 last edited by

          This is for example https://fxdreema.com/shared/IofZNPYwe

          all well done but why be opened on trade.

          How should I set that one signal makes one trade?

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

            I can see your projects even without sharing 🙂

            You need to buy and sell, this is forex after all. The question is when and how much to buy and sell. But there is no one rule for that. Someone may want to trade on each candle. Other may want to trade once a day, when some condition happens. Other may want to buy when conditions reverse. Other may want to have 1 trade all the time.

            EAs are working on events. Certain part of the code is executed... sometimes, on a given event. The most important event is the "Tick" event. When a new tick comes, MetaTrader causes this part of the code to run. As you can suggest, all blocks under "on Tick" are running on every tick. Your block 59 is running once for every tick. Blocks below... depending on the block/s above.

            Remove that block "AND", it's not needed, it's the same without it.

            Your strategy is now like this:

            1. When a tick is received, check how many trades there are
            2. If there are 0 trades, check if RSI is above 50, otherwise stop here and wait for the next tick.
            3. Check if the server time is between 8:00 and 20:00. If not, stop here and wait for the next tick.
            4. Create Buy trade. That's all.

            On the next tick everything will be the same. But when you finally create a new Buy trade, 1) will not pass anymore. When your Buy trade is closed for whatever reason, 1) will pass again.... until you got another Buy trade.

            As I already said, if you want to limit the number of trades by time, add some block like "Once per bar" or "Once a day". There are other scenarios as well, this is the most simple.

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

            Online Users

            S
            A
            B
            A
            J
            D

            14
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors