Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 23:46:03 +0000



ACSIL QUESTION wait x amount of time until next line is executed?

View Count: 1157

[2015-06-01 02:10:33]
enemyspy - Posts: 304
Hi, I now almost have a stable method for both sending and requesting data to and from server. The only issue now is that when an HTTP request is made the response is generated before the server is able to return the complete string queried to the php page. It needs to send multiple requests before successfully getting the full string.

I want to try and see what happens if the program is forced to wait a couple seconds directly after it executes the http request before proceeding to the next line, if that would have any effect on getting a complete response on the first try?

is there even a way to pause the routine?

even if this was done would it have any effect?
[2015-06-01 02:20:21]
Sierra Chart Engineering - Posts: 104368
This looks like something you need to solve on the server side:

The only issue now is that when an HTTP request is made the response is generated before the server is able to return the complete string queried to the php page. It needs to send multiple requests before successfully getting the full string.


Make sure the entire response is sent at once.
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
[2015-06-05 05:01:32]
Sierra Chart Engineering - Posts: 104368
Only we can delete posts. The way to delete a post is just to edit it and remove the content like you did.

Hopefully you have got the problem solved. If not, we are going to do a code review to make sure the ACSIL study function does not get a partial response from the HTTP server as the data is being received. It will only get a fully complete response. It should work this way, and it is not likely it does not, but we can check.
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
[2015-06-06 18:42:31]
enemyspy - Posts: 304
It does get a complete response eventually its just when I step through the code in Visual Studio it does not get it on the first try. I have to go through several iterations before it gets the whole response. I consistently get it after 2-3 seconds and parsed properly.

I do suspect this is probably due to the way I have the php page coded not the sc function.
Every time the http request hits the url a mysql query is executed and then a while loop echos the arrays returned in the query by row.

So I wonder if what is happening is that the response is coming back to SC as what would be considered a complete response, before the query has finished displaying. This would not be an issue on the SC end. Perhaps I need to figure out a better way generate the response from server.
Just do not know enough about this subject yet to come up with an intelligent solution.
[2015-06-06 18:49:37]
enemyspy - Posts: 304
Due to lack of basic knowledge in many programming concepts I have what might seem like a stupid question:

Does the sc.MakeHttpRequest function control how quickly the response is sent back or does the server side control this?

For instance would it be possible to write something into the server side that delays the response a couple of seconds?
Then I can just add a loop that keeps checking for the response before parsing?
Date Time Of Last Edit: 2015-06-07 03:01:56
[2015-06-07 20:40:32]
enemyspy - Posts: 304
sorry I know this is probably getting annoying. I am trying a different approach now. Instead of making a request to a server I am wonder if it is possible to pull the data locally from a text file:

I tried the following:

SCString URL = "File:\\\C:\httprequest.txt"
sc.MakeHTTPRequest(URL)
returns an error. Any other approach to just import the values from a local file?
[2015-06-07 21:06:34]
Sierra Chart Engineering - Posts: 104368
To work with files refer to:
http://www.cplusplus.com/reference/cstdio/
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

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

Login

Login Page - Create Account