fxDreema

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

    I don't get this ea working

    Questions & Answers
    2
    4
    916
    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.
    • bk7
      bk7 last edited by

      I am trying to get an ea that:

      1. runs from a defined start time to an end time

      2. opens pending orders at a certain time of the day

      3. checks how each trade ended up (TP/SL/TS)

      4. Counts for each pair it runs on the number of TP SL TS trades of today

      5. If the amount of trades are under a certain value the ea should check:

      6a) if since the last closed buy trade of the pair the price opened and closed above a certain level and if this is true it should place a new pending order at a certain level

      6b) if since the last closed buy trade of the pair the opened above a certain level and if this is true it should place a new pending order at a certain level

      7a) if since the last closed buy trade of the pair the price opened and closed above a certain level and if this is true it should open a new order if the price closes at a maximum amount of pips above a certain level a new buy order

      7b) if since the last closed buy trade of the pair the price opened above a certain level and if this is true it should open a new order if the price closes at a maximum amount of pips above a certain level a new buy order

      i have no problems with 1 and 2. I also tried to work with a loop but this didn’t work.
      So i would be very grateful if i could get some help for points 3-7, thank you 😏 ⚠ ⚠

      EDIT:

      Here is what i have so far but it still doesnt seem to work 😕

      https://fxdreema.com/shared/j2GlTgNbd

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

        I think I wrote this somewhere, but I don't like those AND blocks. I don't understand what are they doing there.

        Also, I can't see what these loops are doing. Note that "For each ...." is able to run the next block/s multiple times for every single run of that block.

        "Check trades count" has nothing to do with the loop. These blue blocks have their own loop inside, they don't care of the outside world. So I don't see what these blocks are doing there as well.

        Again, I don't understand the idea behind the detection of TP/SL/TS. What other ways to close a trade exists? Note that Trailing stop closes trades using the native OrderClose(), there is nothing special about this. Only this that the close price is not the same as TP or SL. In other words, we can detect 3 ways of how a trade was closed - by TP, by SL or otherwise. If you are counting all trades closed by TP, SL and TS, you actually count all closed trades. It will be much easier to not check how were they closed, just count them, it will be the same result.

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

          The idea behind this detection is that i want to trade a certain level for a day long and another level short.
          So i need to see how the last trade ended up. If the buy Trade hit the TP a defined number of times i dont want to trade any buy trades from this level anymore today. But if it was stopped out by a Trailing Stop i might want to reenter a pending order position if some criterias are matched and if it hit for example twice the SL a day i also dont want to enter any more pending buys for this day.

          Do you see now why i need to know this?

          So if i go with the trade closed by SL and TP parameters i need do filter the SL Trades into real SL and TS hit. Since TS is also Stoploss but for buy SL>open price and for sell SL<open price I think i can do it like this or?

          https://fxdreema.com/shared/yAB90mOBd

          So if this is right and this counts the number of each trade how it ended. I need to reset the Variable V1/V2/V3 etc.. on a daily basis so it starts a fresh count each day ? probably this is an on time- modify variables - to 0 - function?

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

            Yes, you need to reset this variable sometimes, maybe once per day. You are right, TS closes the trade by SL. Sorry, there is no special way to detect for sure that the trade was closed by TS.

            Another other way is to check the profit(loss) instead of how many SL were hit.

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

            Online Users

            M
            H
            C
            D
            G
            T
            N

            16
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors