fxDreema

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

    Calculate order open to current stop for all trades running

    Questions & Answers
    3
    7
    1947
    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.
    • J
      james last edited by

      I'd like to be able to calculate the distance between order open to current stop for all trades running. This would be a constantly changing figure, and would I suppose be within a trade loop, but I can't figure out how to do it in fxDreema, and my programming isn't up to doing it manually! 🙂

      Anyone have any ideas?

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

        If "order open" means "open price", what is "current stop"? 😮

        1 Reply Last reply Reply Quote 0
        • J
          james last edited by

          I asked the query on the http://forum.mql4.com/54522 MT4 forum also. Now I have a custom mql4 block containing:

          
          int total=OrdersTotal();
          double v1=0;
          SumAllTradesToStopDistances=v1;
          
          for(int pos=0;pos<total;pos++)
              {
               if(OrderSelect(pos,SELECT_BY_POS)==false) continue;
               v1=v1+MathAbs(OrderOpenPrice()-OrderStopLoss());
               SumAllTradesToStopDistances=v1;
              }
          Comment("SumAllTradesToStopDistances is: ",SumAllTradesToStopDistances;
          
          

          And SumAllTradesToStopDistances set up as a variable to use elsewhere.

          This seems to do the trick.

          Thank you very much, also.

          1 Reply Last reply Reply Quote 0
          • J
            james last edited by

            I'm experiencing strange behaviour with this block and code now in the new local version.

            I can create this block OK, and input the script, and save it. Then later when I re-edit I get an error message at the top of the screen in a pink surround saying, "Error: Wrong data".

            Any thoughts?

            Clipboard02.jpg

            ......
            Clipboard02.jpg

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

              I missed to look about that problem in the local version, but I will check it later... now I'm trying to understand some mystery that causes the whole website to extremely slow down 😕

              1 Reply Last reply Reply Quote 0
              • P
                pandora last edited by

                ......AHHHH then it is not my connection!!

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

                  There is some problem with MySQL on the server, it seems that it works slow as hell sometimes and it tooks tens of seconds to do something very simple, especially within the forum. The technicians said that they have started to repair it, and I hope that it will be ok soon. I really sorry for the troubles.

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

                  Online Users

                  E
                  S
                  N
                  O
                  M

                  12
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors