fxDreema

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

    Send HTTP request

    Questions & Answers
    5
    35
    18984
    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.
    • C
      coverman last edited by

      One question. Continuing this...

      I tried with the one called Close Price, but it doesn't seem to be the last value.
      When I run my script I guess it gets a trigger and a value of the actual value of the currency.
      I managed to get the open price or close price of the last candle. But isn't there any way to get the value when it's running the script?
      The bid price at the time when it's getting the signal from an indicator?

      I'm a little confused with all the terms and not sure what it might be called.
      I thought it might be Open Price, but not sure it is. It doesn't look like this. Or is it the correct one?
      😎

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

        The current Bid price is easy, the first option in Market Properties (in Condition)

        1 Reply Last reply Reply Quote 0
        • C
          coverman last edited by

          Yes. There it was!! I was looking in the wrong blocks I guess...

          Thank you!!

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

            But note that there can be difference if you get Ask/Bid before of after Buy/Sell blocks. You know... it takes time to send the trade request.

            1 Reply Last reply Reply Quote 0
            • C
              coverman last edited by

              Yes. But at least it's pretty close. And that is enough for me.
              It's just what I was looking for.

              🙂

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

                Bumping this topic. At the moment i am trying to shutdown my computer with a POST Webrequest that should trigger an external script on address:

                http://localhost:8000/?action=System.Shutdown

                Allow Webrequest under MT4 is enabled and the HTTP request address is the exact same as mentioned above.
                Errors i am getting are:

                WebRequest error code: 5200
                WebRequest Error: Invalid URL (http://localhost:8000/?action=System.Shutdown)

                I tried a different URL, which gave me another error code: 4000, among with response code 405. I did some searching and this apparently means "no error". Now my question is what options i have with above address. Should i make a domain and redirect its URL to the address that has my script or is there another solution?

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

                  I don't remember if it's ok to use GET parameters in POST request. I'm also not sure about the port. I mean, I have to make tests, just like you, to tell what is not working. Try with setting file name, like index.php?action=... Also try with variable value that does not contain point symbol. In this short address you have many possible things that can cause the problem, but I can't tell you which one is the right one 🙂

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

                    An other Question regarding http Request:
                    How to get the result of http request for use in a condition?

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

                      I think it's obvious in Condition. I don't know what have you tried, but yesterday I made some changes in almost all blocks so there is a chance for something broken. You tried this and it doesn't work?

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

                        Not so much obvious: There are 10 KeyValue Pairs beside the Address and Method. and there is a way show response in a Message box.
                        So its something thats not so obvious, how to take a not boolean result from a block to elsewhere.

                        Maybe I want to evaluate the http response code or returned number / string to reuse it somewhere in my EA.

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

                          If you don't specify delimeter in "Send HTTP request", then the expected response is one single value, plain text. No key should be specified in Condition.

                          If you specify delimeter in "Send HTTP request", then the response should be like this "value1,value2,value3" if the delimeter is ",". In this case the response text is exploded with the same delimeter and it will look like ["value1", "value2", "value3"]. These values have keys such as 0, 1 and 2. No associative arrays here and no JSON.

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

                            Yeah thats what I am looking for but there is no delimiter field for the httpRequest Block ... maybeDesktop Version is old again?

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

                              Yes, it is 🙂 I updated this block in the middle september, month after I updated the whole fxDreema.

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

                                So its not in Desktop Version?
                                OK,I changed my PHP Code toreturn a single Number as workaround but i didnt get this number into a double variable.
                                Its because HttpResponseText is a string.

                                Where in the blocks can i do the StrToDouble to use the Number for Calculations?

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

                                  __
                                  Where in the blocks can i do the StrToDouble to use the Number for Calculations?[/quote:1509cp0l]

                                  Everywhere

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

                                  Online Users

                                  S
                                  O
                                  K
                                  M
                                  M
                                  C

                                  21
                                  Online

                                  146.7k
                                  Users

                                  22.4k
                                  Topics

                                  122.6k
                                  Posts

                                  Powered by NodeBB Forums | Contributors