fxDreema

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

    Do Not Open Trade on Same Bar That Trade Closes

    Questions & Answers
    2
    4
    1534
    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.
    • K
      keydcuk last edited by

      Hello Mr Fxdreema,

      I have tried to figure out a way to tell my EA not to open trades on the same bar that a trade closed with no success.

      Is there a way to do this?

      Many Thanks & Best Regards,

      Daniel

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

        I would try something with "Once per bar" first. Otherwise here is some idea - https://fxdreema.com/shared/fUyUrQuxe

        1 Reply Last reply Reply Quote 0
        • K
          keydcuk last edited by

          __I would try something with "Once per bar" first. Otherwise here is some idea - https://fxdreema.com/shared/fUyUrQuxe[/quote:33vtn65u]

          It is a hard one. I have worked with once per bar and was not successful. This "For each closed trade" block, I have not noticed this one before, so maybe it is where I need to go to make it work. Could be that and a once per bar block, I don't know. This is all I need to see is if there is a closed trade on a bar, do not trade the bar. I might get away with using something where if last closed trade was a buy don't open a buy trade, if last closed trade was a sell, then don't open a sell trade as the system I was using would likely open a sell next. It is just that because the buy and sell conditions are easy and wide, when I close to TP, that buy or sell condition often still exists but too late to risk entering other trades again.

          Thanks for your help and advice.

          Daniel

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

            Each candle has few components - 4 prices (Open, High, Low and Close), Volume and Time. What is that Time... this is an integer (whole number) value that actually looks like this - http://www.epochconverter.com/. My idea was to compare the Close Time of the last closed trade with that candle Time. What "For each Closed Trade" does is to select that last closed trade, so we can read it's Time and compare it with the candle's Time. If the trade's Time is > than the candle's Time, this means that the trade was closed after the candle has started.

            The thing is that there is no block like "How many trades were closed at bar X", that's why I did that with these pink block. But such a block sounds like a good idea actually 🙂

            "Once per bar" does very different things, it does not care if there are trades or not. But if it can be used for the logic, why not.

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

            Online Users

            E

            13
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors