fxDreema

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

    Issue with magic number

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

      I created rule set for trading. If one of the rule is not met then it alerts me with the information. If all rules are met then it places one trade. I would like to use it as semi-automated script - I add it to my chart and then it start alerting me which criteria is not met. After that I drag a next currency into my chart and then it tells me also which criteria is not met (about that spefic currency). Rule set begins with block "No position" (MT5). In condition where all criterias are met and it places a trade it stops alerting me. If I drag next currency into my chart it doesn't alert me anymore. If I delete the placed trade it will place the same trade again despite the fact that I dragged new currency into my chart and it should place a trade with current currency. I think that the EA stops, because current Magic Number has placed a trade (it doesn't matter if the currency has changed). But I wish that it is working continously - after placing one trade in specific currency it will continue to alert me on another currency chart and placing trades also.

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

        I made this project to test: https://fxdreema.com/shared/JV80bhHue

        I found out that it happened with project generated by the website, but not if I compile the .mq5 file with MetaEditor. I investigated a little bit and at the end I uploaded the latest compiler. I think that it works now.

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

          @fxdreema said in Issue with magic number:

          nd at the end I uploaded the latest compiler. I think that it works now.

          Thank You for Your reply! The comment will appear on chart when I drag new currency.

          My problem is also that I am using "No position" block, but if my semi-automated script will place a trade then it would not go through that "No position" block again, despite the fact that I have changed currency.

          I need that my script is using following logic:
          If all trade conditions are not met - alert me
          If all trade conditions are met - place one trade
          --- Now I change currency and it should start checking all trading conditions again, but unfortunately if it just placed a trade then it stops, because I use "No position" block and the script with this current magic number has placed a trade.

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

            So you place positions manually. Is the EA capable of working with manually created positions, because normally the EA uses some magic number, which is different than 0 (for manually created positions the magic number is 0)? Maybe the EA is doing its thing because it doesn't see that manually created position.

            This is where you control the magic number - globally for the EA or in a single block:

            0_1559559329586_85d4b293-bc3f-4088-bb84-6f2e3a66c22b-image.png

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

            Online Users

            T
            P
            C
            S
            T
            I
            B
            A

            17
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors