fxDreema

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

    Tutorial Loop [advanced?] - find and save specific value from indicator history

    Tutorials by Users
    6
    21
    14320
    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.
    • M
      miro1360 last edited by miro1360

      fast tutorial how to find specific value in indicator history
      my tip is, use Loop block

      original project: 0_1488923868468_tutorial_loop.mq4
      link: https://fxdreema.com/shared/CS0MvwQSc

      here was question, how to find atr max/min values in specific period
      https://fxdreema.com/forum/topic/4507/indicator-average-value-ichimoku
      so we will find atr max and min and save it into variables for further calculation

      1. create few inputs:
        0_1488911315767_upload-93c69050-e4b9-41b1-ada7-cc5cfdbcc65b
        and variables:
        0_1488911327196_upload-468f822c-41b3-4e63-aaac-aa072a8deb8c
        values are saved into variables atrMax and atrMin
        variable atrNew is needed for temporary saved atr value and variable incr is needed for incrementation candle ID
        input lookBack is period where are you looking for values min max and atrPeriod is period of atr 😄

      2. next create this block connections:
        0_1488923973125_upload-b0c2b550-ecff-4819-b75d-44f1864ffc45
        firstly you need null variables before loop start, atrMax is 0 but atrMin is "nulled" into high value because for further comparison

      block Loop have in parameter lookBack period - it is, how many times is this loop repeated
      0_1488924017571_upload-15107ba4-1f93-46a4-8672-18c2f4500e14

      next is save atr value from candle ID (variable incr) into variable atrNew:
      0_1488924125470_upload-293d7c93-ce8a-40dc-8faa-95a583a6f5a2

      block Condition for comparing if atrNew is > as atrMax:
      0_1488924186034_upload-1615e023-e577-4246-a061-700c99bb994c

      if that is true, save atrNew into atrMax (atrMax=atrNew)
      0_1488911784597_upload-3fa6f149-d5e2-4016-bf80-26a907d3285a

      the same logic is for atrMin with slightly change in Condition:
      0_1488911834504_upload-2805c643-eecf-4c99-913e-8b66d1e9a935

      1. after that atrMax and atrMin are saved and if loop find on lookBack period new atr which is higher/lower as previous, it is saved ... in that case dont forget for candle ID incrementation which is done with incr variable in next block:
        0_1488924252866_upload-17035187-a9ba-4c69-a60e-b7e9582d9581

      2. with Comment check if it is working:
        0_1488924291054_upload-d54fdb57-3817-4ed7-8aa8-f0f4c4e580f9

      see, it is working:
      0_1488912065988_upload-2e6ba5ca-0b76-4488-83d7-89f4411edff7

      ...
      the same logic you can use for moving average, RSI, stochastic, macd, custom indicator and all others

      😉

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

      V Z 3 Replies Last reply Reply Quote 5
      • M
        miro1360 last edited by

        another example:
        https://fxdreema.com/forum/topic/5229/confirm-indicator-values-in-loop

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

        1 Reply Last reply Reply Quote 0
        • N
          nemo.vr11 last edited by

          hi miro1360. I'm trying to follow your explanation but I cannot fine the block loop back. I can find (loop) break and (loop) next but none of these have the feld cycle. where can I find it?
          thanks

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

            hi nemo, dont be confused with names, because I slightly renamed blocks to be more specific about their function ... the first line in block name is original name, the second and next lines are renamed by me ... so the original block name is always first line Loop (pass "n" times)

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

            1 Reply Last reply Reply Quote 0
            • N
              nemo.vr11 last edited by

              I found it thank you. is there a way to Know body range size or candle size?

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

                yes, Modify variable block, and somewhere in Candle properties exist this option ...

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

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

                  Thanks Miro for very clear example!
                  Question is using blocks VS custom MQL Code block which is better manage?

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

                    I am not sure what do you mean ....
                    do you mean using custom code between fxdreema blocks? you dont need do it if block exist, if is not exist you can do it or even create own block (in fxdreema studio, check forum for some replies about that) ...

                    or do you mean whole EA in own custom code?
                    here not exist one answer ... because custom code can be done wrong, veery wrong, and therefore very slow ... you must be very experienced when you want create something pure in code, otherwise you will lose time (in that case it is better to learn something else as MQL programming, lets say it is better to learn javascript and web programming)

                    ... fxdreema is using sophisticated system of blocks which are called logically in order/loops ... now it is in OOP, so technically it is really fast ... someone can tell you, that there is a lot of unnecessary code, but it does not matter, because unprofitable EA will create the same loss with both 😄 😄 ... from my experience, fxdreema is the best tool for creating EAs ...

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

                    1 Reply Last reply Reply Quote 0
                    • V
                      vypchela @miro1360 last edited by

                      @miro1360 What needs to be changed in the blocks for the indicator RSI?

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

                        meantime some functions were added, you can do it easily ... import RSI into My Indicators and set the Modify Variables block as this:
                        0_1557029852101_19c1b090-d4c4-4c29-aacf-74727b7ef819-image.png
                        (I have not tested) ....

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

                        1 Reply Last reply Reply Quote 0
                        • J
                          Jimmy Chee last edited by

                          Instant of look back candle is fix at 10. Can I determine the look back candle depending on parabolic sar? Example: if parabolic previously appears below candle is 15 candle before appear on top. My look back candle is 15.

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

                            you can do that with a few variables, it won't be so easy as one block ... at least a few blocks ...

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

                            1 Reply Last reply Reply Quote 0
                            • J
                              Jimmy Chee last edited by

                              I have no idea how to start it. Please show me.

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

                                as I told you, is not that simple ... something like this:
                                https://fxdreema.com/shared/GmgFkC3sd
                                (RSI must be imported in My Indicators)

                                0_1557104668713_9d966914-e47c-441d-8f25-22632e2c01dd-image.png

                                it can be simplified into Custom Code block, this is only demonstration how it can be done from blocks 😄

                                ... note, that parabolic sar is repainted indicator, the previous spot is sometimes repainted - some inaccuracy can appears ...

                                maybe between blocks is some logical mistake, I have not tested it deeply 😄

                                0_1557104901329_8722b80c-0e4b-4240-b8f1-66d3ea2ee452-image.png

                                0_1557104987202_7553b3d4-254b-4ea6-a04a-574b35701c6e-image.png

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

                                1 Reply Last reply Reply Quote 0
                                • J
                                  Jimmy Chee last edited by

                                  I got it. Thank you very much.

                                  1 Reply Last reply Reply Quote 0
                                  • V
                                    vypchela @miro1360 last edited by

                                    @miro1360 Hello, the topic is interesting. The question is: is it possible, based on your example, to find out the maximum size of a candle for a certain period (for example, 24 hours).
                                    Thank you in advance.

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

                                      of course it is, just replace the atr with a candle size

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

                                      V 1 Reply Last reply Reply Quote 0
                                      • V
                                        vypchela @miro1360 last edited by

                                        @miro1360 said in Tutorial Loop [advanced?] - find and save specific value from indicator history:

                                        замените atr на размер свечи

                                        Thanks for the answer, but I don’t quite understand replacing atr with the size of the candle. You can show by example: https://fxdreema.com/shared/cOV5sHiM
                                        Thanks again.

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

                                          0_1570281639906_c642b192-7c44-4892-b201-6e675e29589b-image.png

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

                                          V 1 Reply Last reply Reply Quote 0
                                          • V
                                            vypchela @miro1360 last edited by

                                            @miro1360 Thanks, yes it works.

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

                                            Online Users

                                            A
                                            T
                                            M
                                            E
                                            C
                                            B

                                            27
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors