fxDreema

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

    Once per bar and No position together?

    Questions & Answers
    5
    14
    3330
    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.
    • R
      richard96816 last edited by

      How do I get the effect of Once per bar and No position at the same time?

      Thought I could just string them together, but Once per bar overrides No position in terms of allowing multiple positions to be opened.

      Connecting Once per bar after No position doesn't do what I expected.

      Once per bar is acting like it's at the top of the string of blocks even though its not.

      Thanks

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

        What are you looking for exactly?

        1 Reply Last reply Reply Quote 0
        • R
          richard96816 last edited by

          Sorry if I wasn't clear. I want to activate a possible trade once per bar and only if no position currently exists. The combination of the Once per bar and No position blocks.

          Unfortunately, the Once per bar block appears to override the No position filter and allows multiple positions to be opened.

          I want a No position block that activates on bars instead of ticks.

          Thanks.

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

            Whe you say 'No position' do you mean the 'No trade' block?

            1 Reply Last reply Reply Quote 0
            • R
              rafaelgrecco last edited by

              The block is called "No trade" on MQL4 projects and "No Position" on MQL5 projects, but they are the same thing.

              Make sure you are using the correct block (there is one block for position, one for pending order and one for both).

              It should work like you said: Once Per Bar -> No Position. At least it works on MQL4 projects.

              R 1 Reply Last reply Reply Quote 1
              • isp00rt
                isp00rt last edited by

                I've never worden on mql5. As you say, it works on mql4. I have no idea what's the problem, sorry.

                1 Reply Last reply Reply Quote 0
                • R
                  richard96816 @rafaelgrecco last edited by

                  @rafaelgrecco Thanks Rafael. I was getting multiple simultaneous trades on the one-minute time frame, bar after bar. No paying attention to open positions or trades.

                  Definitely a lack of documentation, help files, demos, tutorials, etc.

                  Lots of surprises and wasted time. 😞

                  Thanks.

                  I was using MT4 but MT5 is sooooo much better for backtesting.

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

                    Once per bar limits by time, while No trade (No position) limits by the number of trades you have. One block passes 1 time for each bar, while the other passes when there is not a single trade at the moment. They do different things 🙂

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

                      @richard96816 with "No trade" block, you could have a lot of closed orders for TP or SL (very tight values) on the same bar, sometimes it is better to put together "Once per bar" and this problem does not happen

                      1 Reply Last reply Reply Quote 0
                      • R
                        richard96816 last edited by

                        I understand these two blocks do different things. It is sometimes helpful to have the combined effect of both. Only pass when there is no trade and only pass once per bar.

                        When I string them together I sometimes get surprising results, like as many as five simultaneous trades running. Seems Once per bar is negating the effect of No position.

                        The name No trade is reasonably suggestive of what it's supposed to do. Once per bar is much more confusing. And the documentation is incomplete. It hints at what it does more than fully explaining it.

                        What happens when you hook various blocks together? Some blocks, like these two, seem like they shouldn't have the connector on their tops. Like they should always be the first block in a chain. I've not seen an explanation of their possible special nature.

                        Maybe I'm putting No trade in the wrong place. Is it legal to put it in the chain just before a Buy or Sell block? Most of the examples I've seen put No trade at the top, suggesting that it needs to be there. (With limited documentation these are the kinds of things users have to go on.)

                        I've seen mention that a single block by itself is not executed. But I don't remember that being well explained or even mentioned more than once. Are any two connected blocks all it takes to enable execution? Which blocks are 'special' in this regard? What are the limitations of this scheme? What blocks shouldn't be 'anded' or 'ored' with other blocks?

                        Thanks.

                        R 1 Reply Last reply Reply Quote 0
                        • R
                          rafaelgrecco @richard96816 last edited by

                          @richard96816

                          "No trade" blocks are usually used at the top, but you can use it anywhere you want.

                          Oncer per ber -> No trade works fine.

                          I am currently working on a project that has almost 3000 blocks of all types and colors. I just added some Terminal Variables to the mix 😛

                          You must understand that it takes some time to understand how this platform (FxDreema) works. I've been working with it for more than 2 years and I am still learning some things.

                          You will get the hang of it.

                          If you need more help, post a screen shot or share your project. It's easier to understand where the problem is if we can see what you are doing.

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            richard96816 @rafaelgrecco last edited by

                            @rafaelgrecco Thanks. I've put some useful things together. But surprises still arise.

                            More complete help files would make the learning curve more bearable.

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

                              Richart, make a small test project in your projects that shows the problem, and I will see it. Or you can share this test project here
                              0_1534523817975_d79c1597-2119-49b9-bc14-54ab1cb83c83-image.png

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

                                @fxdreema Thanks for the response. I worked around it already.

                                Learning to be much more thorough in my testing.

                                Thanks.

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

                                Online Users

                                M
                                P
                                S
                                A
                                E
                                M
                                F

                                23
                                Online

                                146.6k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors