fxDreema

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

    Baby Steps

    Questions & Answers
    3
    21
    4741
    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.
    • D
      danerius last edited by

      Hi

      So Ive come to realise I need to baby step my way in to fxdreeam and ask for help every step of the way. Ive tested a strategy in Open Office and would like to make an EA

      First of all. It divides Low price by the High Price and then takes that to the power of 20

      How would I go about doing that?

      Thanks and regards /Bo

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

        That's interesting strategy, power of 20...
        This is one way to do it:
        0_1525358929014_8b6ba3a5-067c-4f63-be34-a46e1a1db5a2-image.png
        https://fxdreema.com/shared/6KnVT6Zke

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        1 Reply Last reply Reply Quote 0
        • D
          danerius last edited by

          Hi. Awesome. Thanks so much πŸ™‚

          This is the first part of a strategy/indicator. Theres is one more formula but I thought Id start with this

          The idea is to indicate when there is market is in consolidation. I figured the proportion in Low/High Price would be a good way

          How do I get this in a separate indicator window?

          Regards /Bo

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

            I'm afraid I can't help with the separate window, I guess you need some custom indicator coding there..
            I have just used the comment-block to view my formulas - the downside is that you see only the latest calculation.

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

            1 Reply Last reply Reply Quote 0
            • M
              miro1360 last edited by miro1360

              for consolidation use Bollinger Band Squeeze indicator ... green dots is trend, red dots is consolidation

              alt text

              Between trading and gambling is a very small gap, be careful.

              1 Reply Last reply Reply Quote 0
              • D
                danerius last edited by

                Thanks Miro

                I understand what youre saying. But I have a slightly different end goal in mind. Im looking to produce a curve that has a high value at consolidation. And a low for the opposite. And then base an EA on that

                The Bollinger Bands are derived from a Close Price Standard Deviation and values can vary a lot. Whereas comparing High and Low Prices seems to be a bit more stable and better for what I had in mind

                Regards /Bo

                1 Reply Last reply Reply Quote 0
                • M
                  miro1360 last edited by miro1360

                  0_1525388901672_miro1360_test_1.0.mq4

                  here is simple custom indicator with separate window, start from that, later you can use it in EA ... you can understand it easily, it is very simple ...

                  0_1525389048500_a63593fa-d53e-4b8d-a970-1eb58ad4c84a-image.png

                  Between trading and gambling is a very small gap, be careful.

                  1 Reply Last reply Reply Quote 0
                  • D
                    danerius last edited by

                    Duuude... Thats brilliant

                    How did you do that?

                    /Regards

                    1 Reply Last reply Reply Quote 0
                    • M
                      miro1360 last edited by miro1360

                      just few lines of code in metaeditor ...

                      this is your computation logic in code, which you described above

                      for loop goes through candle IDs (but only once, barsToCalculate is my own function to speed up indicator and not recalculate all bars in history when barsLimit is set to 0 ... (it calculate history bars only once and than calculate only current candle) ... when you use it in EA, set input parameter barsLimit to some reasonable number, like 10 --- only 10 bars will be calculated) ..
                      0_1525464527991_074ff165-0dc9-4cdc-bf95-de7a97242fe8-image.png

                      Between trading and gambling is a very small gap, be careful.

                      1 Reply Last reply Reply Quote 0
                      • D
                        danerius last edited by

                        Excellent and a big thanks for the code. From what little coding I know - 9t looks really elegant πŸ™‚

                        This High/Low comparison is the first block of a four part thing.

                        Second part is an Weighted Average of the High/Low results. Third part is a formula for adapting the results to control other indicators. And lastly hooking that up that to the indicators and test wether its working as I intended

                        Can I use the regular WMA code with your code?

                        Regards /Bo

                        1 Reply Last reply Reply Quote 0
                        • M
                          miro1360 last edited by

                          second part still simple πŸ˜„

                          0_1525631996117_miro1360_test_1.0.mq4

                          0_1525631965357_99fed2ba-436c-4c59-924c-c8536c463826-image.png

                          not much changed... note that it can be done better ... but we are not going to create graphics for games so you can do code as you want, here it does not matter ...

                          0_1525632089540_c1ff59ae-3d44-432d-95d9-71f4f49ff50b-image.png

                          third+last part I think can be Condition blocks in fxdreema (you can import this indicator into My Indicators, and compare results with other indicators) ...

                          Between trading and gambling is a very small gap, be careful.

                          1 Reply Last reply Reply Quote 0
                          • D
                            danerius last edited by

                            Awesome Miro

                            Thanks a million for this. Im hard at work on this now πŸ™‚

                            Regards /Bo

                            1 Reply Last reply Reply Quote 0
                            • D
                              danerius last edited by danerius

                              Hello Miro

                              This formula didnt go fully to plan. It only worked at the 1 Minute Time Frame. So it needs some additions. I thought Id start with making a High/Low Percentage to Close Price. So essentially High divided by Low. Then the sum of that divided by Close. And then times 100 for a percentage sum.

                              What do I need to add to make a formula lie that work?

                              Thanks /Bo

                              int i;

                              for(i=barsToCalculate();i>=0;i--)
                              {
                              double priceHigh = iHigh(Symbol(), Period(), i);
                              double priceLow = iLow(Symbol(), Period(), i);
                              double lowHigh;

                                if(priceHigh != 0) 
                                { 
                                   lowHigh = priceLow / priceHigh;
                                   Buffer0[i] = MathPow(lowHigh, 20);
                                }
                                else
                                {
                                   Buffer0[i] = 0;
                                }
                              

                              }

                              for(i=barsToCalculate2();i>=0;i--)
                              {
                              Buffer1[i] = iMAOnArray(Buffer0, 0, maPeriod, 0, (ENUM_MA_METHOD)maMode, i);
                              }

                              1 Reply Last reply Reply Quote 0
                              • M
                                miro1360 last edited by

                                how the formula looks like exactly? can you type it in format similiar to this?

                                ((A / B) + ((A + B) / C)) * 100

                                A = High
                                B = Low
                                C = Close
                                and so on ...

                                Between trading and gambling is a very small gap, be careful.

                                1 Reply Last reply Reply Quote 0
                                • D
                                  danerius last edited by danerius

                                  Hello Miro

                                  In Excel - it would look like this. =((A/B)/C)*100

                                  And then a Weighted Average on that sum

                                  Thanks πŸ™‚ /Bo

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    miro1360 last edited by

                                    0_1526976663436_miro1360_test_1.1.mq4

                                    this is how calculation looks like:

                                    0_1526976643884_106b0f3f-2a89-4f9a-b6c5-b8b673f0f290-image.png

                                    0_1526976686174_cfd28e78-c88c-4f88-8b29-a1b950c9f318-image.png

                                    Between trading and gambling is a very small gap, be careful.

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      danerius last edited by danerius

                                      Awesome. Thanks Miro

                                      I got it to work as intended.
                                      Not quite as I expected but thats why Im testing things πŸ™‚
                                      Back to the drawing board

                                      /Bo

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        miro1360 last edited by

                                        yes, that is what forex teach you .... 99.9% of fails and 0.1% of small success πŸ˜„ πŸ˜„

                                        Between trading and gambling is a very small gap, be careful.

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          danerius last edited by

                                          Yep

                                          But Im having fun so Im gonna keep going πŸ˜„

                                          /Bo

                                          1 Reply Last reply Reply Quote 0
                                          • D
                                            danerius last edited by

                                            Hello Miro

                                            Im considering adding a Simple Moving Average to the same window. Im guessing this is the code for the existing Weighted one?

                                            Buffer1[i] = iMAOnArray(Buffer0, 0, maPeriod, 0, (ENUM_MA_METHOD)maMode, i);

                                            How would I modify it for A Simple MA? Also? Im presuming that I need to change other code as well? ”plot buffer”....?

                                            Thanks and regards /Bo

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

                                            Online Users

                                            M
                                            A
                                            A
                                            R
                                            S
                                            P
                                            R

                                            18
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors