fxDreema

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

    Conditional within loop

    Questions & Answers
    3
    4
    2517
    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
      doperthancereal last edited by

      Hello,
      Been having difficulty adding conditionals to loops, what I want to do is for every trade, once lets say 10 and 100 SMA crossover happens, add volume to my trade every 5 pips. Do you add the block before the loop? It didnt work so I added it towards the end. (image below)

      Any help much appreciated, thank you!
      ![alt text](0_1482963943672_dreama.jpg image url)

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

        ma cross happens - it happens between two candles, but on next candle there is no cross, only MA5>MA20 ... on next candle will be your condition (block 307) false ...
        instead of AND block 379 you can connect block 307 directly
        ... but result from your blocks connection is repeatly adding to volume when conditions are true (tick after tick) ... for this, after adding to volume (after whole loop) you need some flag to deactive cross condition and wait for next one

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

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

          Just wanted to thank you for your help!! Problem solved. What I was looking for was more of a "while" loop, while x condition is happening, loop.

          Cheers

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

            Be careful when a block is outlined in red or blue. Red outline means that the block is added to the output code, but will be unable to run. That blue outline also means something very specific... which is also hard to explain here, but you can see this: https://fxdreema.com/demo/mt4-wait-crossovers

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

            Online Users

            A
            T
            M
            E
            C
            B

            15
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors