fxDreema

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

    How does this variable change value?

    Questions & Answers
    2
    4
    1462
    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
      SydneyFox last edited by

      I am developing an EA to trade from user defined support and resistance zones. Generally price will be outside the zones when the EA is initialized but sometimes that is not the case. If price is within a zone I have blocks to change both a flag (BuyZone_5 or SellZone_4) and variable (BuyZoneBars or Sell ZoneBars).

      It works correctly for zone 5 (buy zone) but not zone 4 (sell zone). It is determined by the close price of candle ID 1.

      For sell trades if Close candle id 1 is greater than SellZone_4 it works correctly but if it is less than SellZone_4 then it still acts as if it is greater than the level. This is because it thinks that SellZone_4 is equal to 0.

      A copy of the EA can be seen here https://fxdreema.com/shared/rrJB9hDsd.

      I have a number of comment blocks so that I can see where the EA breaks down. Unfortunately I can't understand why it is happening.

      If you enter a value in Res_1 that is say 50 pips above the close price then one comment will say that SellZone_4 + true even though it isn't so.

      Comment block 237258 will give the correct value but comment block 473968 will give a value = 0. This is very confusing to me as block 237258 activates before block 473968 and the only block in between 473965 makes no change to the variable.

      I would really appreciate some help with this? @fxDreema @miro1360 ?

      If I change the value of Sup_1 (zone 5) it works correctly but not for zone_4. I;ve spent about 6 hours trying to figure this out today but with no luck.

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

        why are you working with such strange block numbers? 😄
        maybe your problem is somewhere in blocks arrangement ... for formula blocks try them place one after another

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

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

          Hi @miro1360 I'm working with such strange block numbers as per this query https://fxdreema.com/forum/topic/5926/block-ids that I am yet to receive a response on. I could normalise the block IDs in this small EA as it's only trying to sort out the variable change value issue but it'll take me longer to change the various delete comments in my full EA. Unless you have any suggestions on that as well?

          I will try placing the formula blocks one after the other but I can't see how this can help as the correct formula result is in comment block 237258 which is after all of the formula blocks.

          The other thing that doesn't make sense to me that I didn't mention previously is the two comment blocks I have placed after sell condition block 473965. Only one of these two comment blocks (473966 and 473967) should show depending on whether the condition is met or not. i.e. is the close of candle ID 1 > sellzone_4?

          When this is the case only comment block 473966 is actioned. This is correct. However, when the candle close is less than sellzone_4 both comment blocks are actioned. How can this be? @fxdreema? The condition is either met or it isn't, so surely only one of the comment blocks should be actioned? Is this a bug in the system? I assume not and it's something that I'm doing wrong but i'm pulling my hair our trying to figure it out.

          If you place the EA on a chart you will see that if block 473965 is correct that both comment blocks 237258 and 473968 will show the same levels for each sellzone. But when a value is used that means that block 473965 should not pass then comments blocks 237258 and 473968 show different sellzone levels. In fact block 473968 shows all sellzone levels as 0.

          There must be someone on here smarter than me who can give me an explanation as to how to fix this issue?

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

            Hi @miro1360 I have no idea why it worked but your suggestion of putting all formula blocks one after another seems to have worked. Thanks for your help.

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

            Online Users

            E
            N
            M
            M
            I
            L

            17
            Online

            146.8k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors