Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

web address to get stock prices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: web address to get stock prices

    Now we've got some info we can work with. 15 posts... but we now know that Version 11 and OpenSSL are your problem... at least when wanting to talk to an up to date world. I've tested this with Version 11 and get the same error you posted. Lots of changes and updates to security...
    https://www.alphasoftware.com/docume...rted%20SSL.xml

    Lenny is your guy for figuring this one out. Version 12 has no issue with the code posted. Version 11 chokes.

    However, Version 11 has no issue with the client-side, Javascript solution posted. As a last resort you can get the data client-side and shove it into XBasic via a callback.

    Comment


      #17
      Re: web address to get stock prices

      the posts were wasted by the moderator moving this thread which was on the correct forum( desktop version 11) to the current location - please see my post #5 as a response to what looks like a web project answer to a desktop question. when moderator moved the question ( neither mike nor alex can do that, as far as i can tell, those were two on the thread for the longest time) could have indicated the inheritance, sadly it wasn't done.
      regardless lenny,
      Code:
      link = "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo"
      timeout = 30000 '30 seconds (in milliseconds)
      result = http_get(link, "", 443, timeout)
      here is the code you provided and i have shown my result via interactive window.
      will you be kind enough to show how you got anything different via interactive window or on a script which will be applicable to desktop side.
      that will be most helpful to mike for sure and as a learning exercise.

      this question and the history is, mike works on the desktop side, and where will the client side fits in is difficult for me to understand.
      thanks for reading

      gandhi

      version 11 3381 - 4096
      mysql backend
      http://www.alphawebprogramming.blogspot.com
      [email protected]
      Skype:[email protected]
      1 914 924 5171

      Comment


        #18
        Re: web address to get stock prices

        Good morning,
        Thanks for the replies. Gandhi, you are correct that I develop on the desktop side. To date, I have not encountered a reason to move certain apps to v12, except maybe now that encounter has occurred. Thank you David for the link. That delivers the likely explanation for the http_get() failure with v11. However, the data can still be acquired using sys_open(). Being a desktop person, I don't have the understanding why you are allowed to acquire data from a server with one method that doesn't require special updated security features but are restricted through another method because it does require special updated security features. Whatever...
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #19
          Re: web address to get stock prices

          Mike, I am not very active with A5 anymore and thus may be way off base here, but is this the kind data your are looking for?
          {
          "Meta Data": {
          "1. Information": "Intraday (1min) prices and volumes",
          "2. Symbol": "MSFT",
          "3. Last Refreshed": "2017-12-15 16:00:00",
          "4. Interval": "1min",
          "5. Output Size": "Compact",
          "6. Time Zone": "US/Eastern"
          },
          "Time Series (1min)": {
          "2017-12-15 16:00:00": {
          "1. open": "86.7199",
          "2. high": "86.8500",
          "3. low": "86.7100",
          "4. close": "86.8500",
          "5. volume": "12977320"
          },
          "2017-12-15 15:59:00": {
          "1. open": "86.6700",
          "2. high": "86.7600",
          "3. low": "86.6600",
          "4. close": "86.7199",
          "5. volume": "354627"

          If so, I got this using V11 and the following code:

          Code:
          url = "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo" 
          '"http://download.finance.yahoo.com/d/quotes.csv?s="+vsymbol+"&f=sl1d1t1c1ohgv&e=.csv"
          result=http_get_page2(url,.f.)
          
          '*********** for testing
          CLIPBOARD.SET_DATA(result)	'capture just for testing
          end
          '**********End for testing
          If this is way off base, sorry for wasting your time.

          Ray Lyons

          Comment


            #20
            Re: web address to get stock prices

            Originally posted by Raymond Lyons View Post
            Mike, I am not very active with A5 anymore and thus may be way off base here, but is this the kind data your are looking for?
            {
            "Meta Data": {
            "1. Information": "Intraday (1min) prices and volumes",
            "2. Symbol": "MSFT",
            "3. Last Refreshed": "2017-12-15 16:00:00",
            "4. Interval": "1min",
            "5. Output Size": "Compact",
            "6. Time Zone": "US/Eastern"
            },
            "Time Series (1min)": {
            "2017-12-15 16:00:00": {
            "1. open": "86.7199",
            "2. high": "86.8500",
            "3. low": "86.7100",
            "4. close": "86.8500",
            "5. volume": "12977320"
            },
            "2017-12-15 15:59:00": {
            "1. open": "86.6700",
            "2. high": "86.7600",
            "3. low": "86.6600",
            "4. close": "86.7199",
            "5. volume": "354627"

            If so, I got this using V11 and the following code:

            Code:
            url = "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo" 
            '"http://download.finance.yahoo.com/d/quotes.csv?s="+vsymbol+"&f=sl1d1t1c1ohgv&e=.csv"
            result=http_get_page2(url,.f.)
            
            '*********** for testing
            CLIPBOARD.SET_DATA(result)	'capture just for testing
            end
            '**********End for testing
            If this is way off base, sorry for wasting your time.

            Ray Lyons
            exactly, it is. this is what jerry said in another post, i could not locate it ( see my post #5)
            (i erroneously said http_fetch_page2)
            thanks for reading

            gandhi

            version 11 3381 - 4096
            mysql backend
            http://www.alphawebprogramming.blogspot.com
            [email protected]
            Skype:[email protected]
            1 914 924 5171

            Comment


              #21
              Re: web address to get stock prices

              It also works in V10.

              Ray

              Comment


                #22
                Re: web address to get stock prices

                very good, thank you for appropriate answer.
                learned something new.
                thanks.
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #23
                  Re: web address to get stock prices

                  Ray,
                  Badda Bing! That would be it. I swear I tried every http_X method after Gandhi suggetsed I try others, but clearly I did not. This is data I can parse. Thank you so much!!

                  Later:
                  Code:
                  dim vstock_price as C
                  dim vsymbol as C="GE"
                  url = "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol="+vsymbol+"&interval=1min&apikey=csv" 
                  result=http_get_page2(url,.f.)
                  vstock_price=word(word(word(result,2,"Time Series"),6,chr(10)),2,chr(58))
                  vstock_price=alltrim(stritran(stritran(vstock_price,chr(34),""),chr(44),""))
                  
                  msgbox(vstock_price)
                  Last edited by Mike Wilson; 12-17-2017, 12:52 PM. Reason: corrected parsing code
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #24
                    Re: web address to get stock prices

                    Mike, Glad it worked for you. Using various StringScanner Methods along with http_get_page2() I have been able to grab a small piece of data out of a large, complex web page (e.g. current price for a specific item). Interestingly my code sometimes fails to return anything, a problem I now suspect can be solved by increasing the timeout for whatever the default is for http_get_page2(). Thanks Lenny for pointing out the timeout option (which is in the documentation though I never noticed it or realized it might be the culprit for why my code sometimes returns nothing when I know what I am after is there). And here I thought I was done with all this stuff!

                    Ray Lyons

                    Comment


                      #25
                      Re: web address to get stock prices

                      http_get() and related HTTP functions use OpenSSL. OpenSSL is regularly updated, and those updates come with Alpha patches. Since V11 is no longer maintained, it does not have the most recent recent OpenSSL DLLs, and as such may have issues connecting to some SSL-enabled servers.

                      The http_*2() functions do not use OpenSSL and instead rely on the OS for negotiating SSL connections. Depending on the version of Windows you are using, yuo will have varying results connecting to SSL-enabled servers. For example, Windows XP would haveWindows 10 have significantly different capabilities, regardless of your Alpha Five or Alpha Anywhere version.

                      Please note that in my very first post, I said that error_text should be examined to see if the request completed successfully. This is key for EVERY HTTP request, as requests may fail for any number of reasons at any time. Remember, you are connecting to a remote service and there are a ton of variables that can impact the operation. As soon as Govindan showed the error text and code in post #13, David was able to properly ascertain that this is an SSL issue with older OpenSSL DLLs in V11. Always check the return status on HTTP calls.


                      For the record (and as requested by Govindan), here is the code I posted running in V12 showing that it gets a response from the server:
                      Code:
                      link = "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo"
                      timeout = 30000 '30 seconds (in milliseconds)
                      result = http_get(link, "", 443, timeout)
                      ?result
                      = body = {
                          "Meta Data": {
                              "1. Information": "Intraday (1min) prices and volumes",
                              "2. Symbol": "MSFT",
                              "3. Last Refreshed": "2017-12-18 16:00:00",
                              "4. Interval": "1min",
                              "5. Output Size": "Compact",
                              "6. Time Zone": "US/Eastern"
                          },
                      <output truncated>


                      And finally, regarding the moving of this thread to General Questions. The original question was:
                      Originally posted by Mike Wilson
                      Anyone have a different address/method to acquire stock prices?
                      There is nothing at all about this that is V11 specific or desktop specific, so the post was moved in order to reach a wider audience and hopefully get better results for Mike. Note that Alexc - the user that gave the web service that Mike is now using - is an Alpha Anywhere user and may not have even seen the question in a V!1 topic.

                      Lenny Forziati
                      Vice President, Internet Products and Technical Services
                      Alpha Software Corporation

                      Comment


                        #26
                        Re: web address to get stock prices

                        Hi Lenny,
                        Thank you for that very detailed explanation. Very helpful! Yes, my bad to not declare the A5 version under development to reach the correct user group. Thank you for your attention to this. And thank you for everyone helping find a solution. The app in use of this originated I believe with A5v7 maybe? I have upgraded the A5 version through the years. We'll see how long it can last. The owner has a rudimentary skill with A5 programming and would continuously change cosmetics, write some reports, able to add a couple of functionalities with action scripting and so forth, so he was willing to buy the A5 developer versions over the years and I would keep it upgraded. However, the days have past where purchasing the newest version of A5 beyond v11 is financially feasible for him. Like me, he doesn't do any work beyond desktop, and while I develop for small companies, he just does it for himself. I wonder how many others out there like this fellow have been lost to the A5 stream of loyal users.
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment


                          #27
                          Re: web address to get stock prices

                          Originally posted by Lenny Forziati View Post
                          http_get() and related HTTP functions use OpenSSL. OpenSSL is regularly updated, and those updates come with Alpha patches. Since V11 is no longer maintained, it does not have the most recent recent OpenSSL DLLs, and as such may have issues connecting to some SSL-enabled servers.

                          The http_*2() functions do not use OpenSSL and instead rely on the OS for negotiating SSL connections. Depending on the version of Windows you are using, yuo will have varying results connecting to SSL-enabled servers. For example, Windows XP would haveWindows 10 have significantly different capabilities, regardless of your Alpha Five or Alpha Anywhere version.

                          Please note that in my very first post, I said that error_text should be examined to see if the request completed successfully. This is key for EVERY HTTP request, as requests may fail for any number of reasons at any time. Remember, you are connecting to a remote service and there are a ton of variables that can impact the operation. As soon as Govindan showed the error text and code in post #13, David was able to properly ascertain that this is an SSL issue with older OpenSSL DLLs in V11. Always check the return status on HTTP calls.
                          ...
                          Interesting and good to know. I suppose my using http_get_page2() is the reason I have never had a problem (yet!) negotiating SSL connections with V10, V11 using XP and Windows 8 and Windows 10. Thanks Lenny.

                          Ray Lyons

                          Comment

                          Working...
                          X