Login Page - Create Account

Support Board


Date/Time: Thu, 18 Apr 2024 15:44:44 +0000



sc.HTTPResponse always empty.

View Count: 1148

[2020-02-21 20:14:22]
marcovth - Posts: 61
Hello ...

Whichever link I am using, sc.HTTPResponse always remains empty. Am I missing something?

sc.MakeHTTPRequest("http://www.sierrachart.com/ACSILHTTPTest.txt");
sc.AddMessageToLog(sc.HTTPResponse, 1);
[2020-02-21 20:32:44]
marcovth - Posts: 61
I tried a test page on a local server (same computer), and the response remains empty as well.

In other words, it's not a firewall issue.
[2020-02-22 07:13:55]
Sierra Chart Engineering - Posts: 104368
sc.HTTPResponse is set sometime later after the study function returns when the server responds.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-02-22 19:31:44
[2020-02-22 11:25:19]
marcovth - Posts: 61
You mean there has to be a pause/sleep after sc.MakeHTTPRequest?

I solved my problem by installing wget on my system and making a system(wget "http://link" -O file.txt) call and then read the file.

This has the added advantage that you can collect data for multiple time frames (multiple wget calls) within the same cycle. If I understand it well from other discussions, sc.MakeHTTPRequest can only be used one time.
[2020-02-22 11:54:45]
marcovth - Posts: 61
For users interested to download their own data, WinExec(wgetCall, SW_HIDE) works better than system(wgetCall) because it hides the prompt.

SCString wgetCall="c:/sierrachart/wget/wget \"https://www.yourlink.com?function=TIME_SERIES_INTRADAY&datatype=csv&symbol=AAPL&interval=5min\" -O c:/sierrachart/data/wget.txt";
//system(wgetCall);
WinExec(wgetCall, SW_HIDE);

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account