fxDreema

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

    CCI & Stochastic levels cross

    Questions & Answers
    2
    6
    2407
    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.
    • A
      AlexAlexis last edited by

      Hi everyone,

      I apologize if this topic has been addressed before, but I searched both in the forum and in the help material and didn't seem to find any mention of it.

      What I'm looking for is how to make an EA that opens or closes a position when a certain level is crossed. Take the CCI for instance. Say I want to go long when the CCI's signal line crosses above the 100 level, and I want to go short when it crosses below the -100 level.

      I can't seem to find a block that will do this in fxdreema.

      Kind thanks,
      Alex

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

        Here is some example: https://fxdreema.com/shared/bkV80cXlc
        Result is here: http://prntscr.com/4m1fer

        1 Reply Last reply Reply Quote 0
        • A
          AlexAlexis last edited by

          Thank you so much Admin! That's great!

          1 Reply Last reply Reply Quote 0
          • A
            AlexAlexis last edited by

            Dear Admin, actually, I've just discovered a small issue!

            The levels I gave are just an example, the real values I want to use are here: https://fxdreema.com/shared/99SwDTCV

            I tested the above EA, and if you take a look at the first attached picture, at the bar between the two green vertical lines, you'll see a trade was opened, but the CCI below didn't go above zero. It probably did touch the zero level because of the tail of the candle, but the CCI was still (re)painting because the candle didn't close.

            So basically I would like an EA that acts only on closed candles. I tried adding the "once per bar" above the series of blocks, but it didn't give the desired result! If you look at the second attached pic, a buy position should've been opened at the red vertical line, but the EA didn't open a position, probably because it compared the bar to the previous one (the green line), and it saw that the CCI was already above the zero line. At least that's my interpretation; maybe that's not the real problem.

            I'm also attaching the CCI indicator I'm using to make for easier visual reference. (Disregard the divergences, I'm only interested in the bars.)

            So is there a way to make the EA take correct action only once a bar has finished?

            Thanks again for all your time and effort here!

            1.JPG

            2.JPG

            CCI_Divergence_v1.mq4

            ......
            1.JPG
            2.JPG
            CCI_Divergence_v1.mq4

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

              Well, in the first case the EA is looking for certain conditions on the current candle, which is unfinished. What you see at the end of the test is not all the information.

              "Once per bar" also works, depending on where it is placed. You can also try with different Candle ID parameter (for example 1).

              Here is how the crossover works in "Condition" block: https://fxdreema.com/documentation/proj ... er%20works

              1 Reply Last reply Reply Quote 0
              • A
                AlexAlexis last edited by

                I tried the Candle ID (1) and everything seems to be working fine now!

                Again, thanks for all your help.

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

                Online Users

                Z
                T
                T
                A
                S

                14
                Online

                146.9k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors