fxDreema

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

    Closing trades for no reason

    Bug Reports
    2
    5
    766
    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
      ScalpfX last edited by

      Hey Dreema!

      Just finishing up my trader and it's having a huge issue thats preventing me from going live with it. Here are both versions:

      1. This one just makes a USDJPY trade while the global variable is toggled to a certain value. https://fxdreema.com/shared/rFjCPAzrc
      2. This one makes a trade based upon the opposite value. https://fxdreema.com/shared/D8lk8K8rb

      Last Thursday during live testing it made 20+ trades (which makes sense) but what doesn't make sense is that from time to time it prematurely closes my trade. This trader only uses stop loss as a closing condition, so it's very concerning to me. I lost 33% of the account because of it! It will randomly close trades, which makes it hard to use the strategy I am using.

      Is there a way you can take a look at it and suggest some alternate configurations to accomplish my goal and/or diagnose the issue I am having?

      Thanks!

      -$fX

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

        You have trades closed by EA, not by SL or TP? This is interesting, because I can't see any block able to do that in these, and I don't think that is possible. The MQL4 function that closes trades "OrderClose()" exists in the code, but it can run only in when Virtual stops are used (when USE_VIRTUAL_STOPS is "yes"). You don't use Virtual stops, so I think that is something else.

        Do you have another EA running in background, some that you forgot that is there and now it does some bad things?

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

          That's what I was thinking!

          I double checked whether or not virtual stops were on, and they were turned off. Is there a way I can just delete the whole virtual stops code snippet?

          It just makes me worried since I intend to go live in a week. If you think of anything please let me know. Even if its just a failsafe that I can build in to turn off autotrading and shoot me an email that would work too. I just need some kind of possible event that would trigger it.

          As always thanks for your time ;D

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

            This function (and few more) is automatically added to all EAs, but you have at the very top:

            if (USE_VIRTUAL_STOPS=="no") {return(0);}
            

            And USE_VIRTUAL_STOPS equals to no at the top of the EA, which means that it's forbidden to enter the body of the function. You can clear it's contents anyway, don't remove the function itself, as it is called from another functions.

            But I think the problem is somewhere else. What are the logs saying?

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

              I dont have access to the logs at the moment, but it didn't say anything in particular about the closes. I am going to leave it in demo for this week again and if I see anything it happening again I will send you screenshots and what was going on at the time. I will remove that variable from the final build and hope it helps.

              You are right though it doesn't seem like the case. Here's hoping 😛

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

              Online Users

              C
              N
              K
              I
              H
              T
              P

              13
              Online

              146.9k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors