fxDreema

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

    Happy Accidents & Better Account Protection

    Questions & Answers
    1
    2
    403
    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.
    • R
      richard96816 last edited by

      I started testing an EA less than a week ago on Demo. The balance is up almost double. But there's an open position with no stop loss that promises to erase 1/4 of the gains. How did this happen. And how do I protect against it?
      I'm guessing my stop was too close, and thus 'illegal'. So it was left unset. I'm computing my stops and may have an error somewhere. (This is why I wanted to dump variable values into the testing log. How do you do that?)
      But how do you check that your Stop Loss and Take Profit are set?
      Things are getting complicated. 🙂
      The good results could be due to trading without stops ... that was not my intent.

      Thanks for your help. And thanks for the cool tool.

      1 Reply Last reply Reply Quote 0
      • R
        richard96816 last edited by

        Okay, never mind. I figured out how to show variables in the tester log.
        fxD can be a treasure hunt as times ... 🙂

        I put this line into a Custom MQL code block and connected it after my Buy and Sell blocks ...

        Print("***** T/P: " + v::TakeProfit + " S/L: " + v::StopLoss + " *****");

        Stuff inside quotes is just text. Variables are prefixed with 'v::'. Constants would be prefixed with 'c::'

        My code was occasionally setting stop loss to zero. 😞 Made a ton of funny money.

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

        Online Users

        X
        J
        A
        N
        S
        E
        A
        M
        T
        M

        19
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors