fxDreema

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

    Loop misfunction

    Questions & Answers
    2
    7
    1144
    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.
    • S
      seb 0 last edited by seb 0

      Hey, im trying to make a looping structure, but i dont manage to make it work.
      What i want is the EA to : - Check the last candles until the 5th one
      - Calculate the average wick size for, the cld0(actual one), for the cdl0+1(actual and previous one) , for the cdl0+1+2 ... cdl 0+1+2+3+4+5
      - Go out the loop as soon as this average is above 5 pips
      - And open sell(short)

      Here is what i made : https://fxdreema.com/shared/T4oNVqQPb

      Note : the journal tells me that the EA checks for 128mb of data then stop. So the loop isn't stopping i suppose.

      1 Reply Last reply Reply Quote 0
      • S
        seb 0 last edited by seb 0

        Actually i think the way the "÷" works(block 7) , is not : X ÷ Y = X/Y
        but = Y/X
        Cause X divides Y.

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

          Since you work with Candle ID 0 (the actual one), you won't be able to do a visual test just that easily, because the triger will be different from the closed value. Anyway, here is one (of many possible) testing purposes which can help you visualize what's going on.
          https://fxdreema.com/shared/Ajn5MAV5c
          I used a different way to loop than you (you still be able to achieve the goal with your loop).
          Have a fun with the Candle ID 0 😄 😄

          0_1574875637695_94988af5-d6a7-4ef1-b29b-a3e31652f4ab-image.png

          0_1574875658166_2b37d304-0d0d-4fad-b1a5-67da354d2f6f-image.png

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

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

            note, the Average Wick (the Red value) is printed as soon as the value is triggered (the closing values may still change, but the Red will be printed and not changed accordingly)
            you may rewrite the logic to do the change ...

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

            S 1 Reply Last reply Reply Quote 0
            • S
              seb 0 @miro1360 last edited by seb 0

              @miro1360
              What is really good is that, there are always many ways to do one thing on FxD.
              Still got trouble from this candle 0(a mistake i did before), i should have noticed that, moreover i think that in this strategy, taking in count the wick size of the current candle before it finishes to form, doesn't really make sense.
              But i've analyzed your construction(took me a bit of time), and i totally got it : ). Except the text code part in draw blocks, i know nothing about coding.
              Im gona use it in in my strategy(not finalized) and tell you if something blocks me, but it should be ok.

              Thanks a lot for taking that time tho!

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

                0_1574908213270_7bd954d5-5f42-46a4-a78c-08220f1cbfbd-image.png

                The function is very very simple. It converts double value to Text (string) format with defined decimals (avgWick is the value, nr 1 is thought to be one tenth). Question is why I used it here in the Draw block? Because it is one of ways how to get rid of weird decimals printed on the chart. Text (code input) selection must be selected, otherwise it doesn't work.

                You can use another functions too (it didn't work here because of the wrong selection, Text (code input) instead of Numeric)
                https://fxdreema.com/forum/topic/8067/trading-tool-with-weird-info-box/5

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

                1 Reply Last reply Reply Quote 0
                • S
                  seb 0 last edited by seb 0

                  Hey back, so as i said i re adapted your model to exclude the upWick of candle 0.
                  I did these change on the project (first picture) :
                  0_1575071914202_Capture d’écran (58).png
                  I had to put the "math ID" adjustment before the wick calculation, so it starts with the cdl 1.

                  There is what it looks like know (second picture) :
                  0_1575072555589_Capture d’écran (59).png

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

                  Online Users

                  L
                  O
                  S
                  E
                  J
                  D
                  M
                  X
                  K
                  E
                  D

                  27
                  Online

                  146.6k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors