fxDreema

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

    RSI & MA needs a tweak

    Questions & Answers
    3
    9
    2484
    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
      andyduvall last edited by

      This is what should happen:

      (Enter the trade with the RSI then exit with the moving average).
      When the RSI crosses above 60 we BUY and then if the MA5 crosses below MA27 we close position.
      When the RSI crosses below 40 we SELL and then if the MA5 crosses above MA27 we close position.

      The problem is that if the RSI crosses above 60 (triggers a BUY) then flickers across 40 it then SELLS and vice versa.

      Is it possible with fxDreema to disable the SELL conditions if the BUY is in progress?

      Here's the flow diagram: http://fxdreema.com/shared/Vuhzexnbc

      1 Reply Last reply Reply Quote 0
      • F
        FxGorilla last edited by

        Hi Andy
        I havent been at this long, but personally I would start the whole lot off with a 'no trades running' block. Link both of the next conditions(the RSI ones) to the orange output of the block. Then the first block will only pass if not trades are running and then it would look for a trade according to your conditions. While a trade is running the first block wouldn't pass(it would actually look to pass through the yellow output) and wouldn't look for another trade until no more trades are running.

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

          I have seen this mistake so many times 🙂

          Ok, let's start with the basics. All these blocks are located under "on Tick". Which means if there is a new tick - this structure will be executed, starting from the blocks on the top. If any block does what it is supposed to do, it passes and if there is something connected after it - it will be executed as well. The whole process happens in milliseconds, if not less than 1ms. Only if there is a trade to buy, modify or close it can take up until a second. Then, when the next tick comes - everything starts again.

          Now you have is, when a tick comes:
          Check Condition#1 and if it's true -> create a Sell position. After the position is created, immediately check Condition#4 and it it is true -> go create a Sell position (actually close what we have).

          Then do the same starting with Condition#5.

          And this all happens because of a single tick!

          All I want to say is that there is no time delay between #6 and #7, and between #2 and #4.
          Condition#4 will be checked only after a new Sell is created by block #2.

          If for some reason Condition#1 and Condition#4 can be true at the same time, you will got a new position that is closed immediately. It there are no moments when both conditions can be true - you will not reach to block #3 at all.

          But you maybe have very crazy result - many positions created and closed in no time. This is because your conditions to open a new position does not include the question - is there a position at the moment? And "Buy now" and "Sell now" does not ask this question, they just to what their title is telling until you are out of money.

          Hint: You can use "If position is running" or "No position is running". Inside those blocks you can also filter by type (buy or sell)

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

            Thanks guys.
            I put the "No position is running" block at the start - this is MQL5, I can't see a "No trades running" block. With the " No position is running" block it just starts a trade and thats it for the whole backtest in MT5.

            I've put the "If position is runing" block after the BUY. It still closes trades with RSI conditions.
            I think it needs to be told that if we're in the middle of a BUY (RSI x>60) and the RSI crosses below the 40 THEN DO nothing.

            http://fxdreema.com/shared/gkLVRXTuc

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

              Now you can try to break the connections 6-9 and 2-10, so that blocks 9 and 10 could be executed on every tick.

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

                Hi,

                I broke those blocks but it still closes trades if the RSI conditions are TRUE not with the MA (saying that it does ok in the backtest).
                Is it possible to state with the "if position is runnning block" to change the Group # (empty=default) to the ID of the BUY block eg 2
                Then only that section will be excuted?
                I changed the filter by type to BUYS.

                http://fxdreema.com/shared/ZTPFxXrId

                thanks

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

                  This is how I think it should work (BUY on RSI and SELL on MA cross overs)

                  http://fxdreema.com/shared/3cV7ywlqc

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

                    Let's start with that: http://fxdreema.com/shared/UdEESeemd

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

                      Thanks, thats great.
                      Its great when it does what you want it to do.
                      I'm starting to see how it thinks.

                      Cheers
                      Andrew

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

                      Online Users

                      A
                      M
                      M
                      M
                      H
                      B
                      N
                      J
                      M
                      P
                      E
                      E
                      S
                      E
                      E
                      M

                      22
                      Online

                      146.8k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors