fxDreema

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

    How to properly set up this EMA situation?

    Questions & Answers
    3
    10
    1738
    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.
    • T
      traderjud last edited by

      I am trying to figure out how to draw out these situations:

      Sell:
      previous candle ( candle 0) is below 8EMA
      current candle ( candle 1) rises above 8EMA
      Current candle (Candle 1) closes below 8EMA
      execute trade at the start of the next candle (candle 2)

      Buy:
      Previous candle (candle 0) is above 8EMA
      Current candle (candle 1) drops below 8EMA
      Current candle (candle 1) closes above 8EMA
      execute trade at the start of the next candle (candle 2)

      I attached a picture of how I thought it should be laid out for the sell (buy is the same concept) but it isn't opening trades correctly?

      any help is greatly appreciated!

      A 1 Reply Last reply Reply Quote 0
      • T
        traderjud last edited by

        0_1552860849285_example.png

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

          I tried your current project and it makes bunch of sells and buys:
          0_1552929187990_e738b15a-4961-4249-aa08-53203091d8cd-image.png
          If you still have the problem, are ypu sure that you are backtesting the correct EA and do you have any errors?

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

            Yes, I know. It isnt waiting until the candle close to execute trades. I was hoping that it would wait until the candle closes to execute trades.

            There are no errors, everything is working correctly. I do not have the parameters set the way that I have it envisioned in my head.

            I want every trade to be executed at the very beginning of a candle, not in the middle of one.

            Thanks for your help!

            A 1 Reply Last reply Reply Quote 0
            • A
              ambrogio @traderjud last edited by ambrogio

              @traderjud I suggest (as I have done several other times) not to use the ID 0 candle, because the zero candle is not defined as it is forming, once formed it automatically becomes the ID 1 candle, so in all "condition" blocks we must use the ID 1 candle

              0_1552949332085_CANDLE_ZERO.JPG

              0_1552949341195_CANDLE_ONE.JPG

              0_1552949396797_Cattura.JPG

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

                @ambrogio

                That made a lot of sense, and I thought that might have been the issue. It still isnt making entries like I was hoping though.

                Here is an example of an Ideal entry:
                https://www.tradingview.com/x/8sfkS8v7/

                1 Reply Last reply Reply Quote 0
                • A
                  ambrogio @traderjud last edited by

                  @traderjud it seems to me that there is a bit of confusion with the candles: the candle 0 is the current candle that is being formed at this time and is not yet finished, the candle 1 is the candle that has just been completed (to the left of the candle 0 ), the candle 2 is the candle to the left of the candle 1 etc.
                  perhaps this is the problem

                  0_1553114038016_candles.JPG

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

                    Yes, I understood that.

                    The issue is, I want candle 0 to break above the 8ema, then the second candle 0 turns into candle 1if it is outside of the 8ema then execute a trade. ( In a sell, break above the 8ema and close below then execute a trade. In a buy, break below the 8ema and close above then execute.) The candlestick would look something like a hammer with the wick going through the 8ema but price closing outside of the 8ema in the direction of the trend.

                    Hopefully this makes sense.

                    A fxDreema 2 Replies Last reply Reply Quote 0
                    • A
                      ambrogio @traderjud last edited by

                      @traderjud please, share your project

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

                        @traderjud said in How to properly set up this EMA situation?:

                        The candlestick would look something like a hammer with the wick going through the 8ema but price closing outside of the 8ema in the direction of the trend.

                        i think this is where you answer to your question. First you explain how candle 0 turns into 1 and so on, but try to look at the situation after it happened. Be in the present moment and look how candles look in the near past. Instead of wondering how to detect multiple rules one after another in the time.

                        So it sounds to me that you want to detect when Candle High is > MA and Candle Close is > MA. I can also see that you did that in your project... but I don't understand why for MA you use candle 1 (the previous candle) and for High/Close you are using candle 0 (the current candle). I think you want to use Candle ID = 1 for both.

                        You also say that you want the candle to close... take a look at this example - https://fxdreema.com/demo/mt4-once-per-bar

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

                        Online Users

                        C
                        P
                        C
                        L
                        P
                        M
                        B

                        10
                        Online

                        146.8k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors