Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 06:49:19 +0000



Question if Server is down

View Count: 757

[2019-06-18 18:07:02]
rahul - Posts: 160
Hello, I am thinking of trading 24/7 through my automated study. Since I won't be in front of the PC, does the backup servers (4 and 1) automatically kick in when an order is sent and server 2 (primary server) is down for that second?

Basically when the order fires, and the server is down, I want it to re-fire when the server comes back online instantly.

What piece of code do I need to add to my study?
[2019-06-18 19:46:58]
Sierra Chart Engineering - Posts: 104368
does the backup servers (4 and 1) automatically kick in when an order is sent and server 2 (primary server) is down for that second?
Yes if these are the backup servers you have specified.

However, there is no order retransmission. We do not regard that as safe.

Also, it is unlikely that an order is going to be sent right at the moment when a server is down and there is a reconnection occurring. If a server is down there is going to be a reconnect to the next available server. And a server going down is very unlikely to begin with.

What piece of code do I need to add to my study?
You have to work out the details of resubmitting order yourself.
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: 2019-06-18 19:47:37
[2019-06-18 22:01:26]
rahul - Posts: 160
Thanks for your reply.
1. Firstly, are the servers configured correctly? Primary = Server 2; Backup 1 = Server 4; Backup 2 = Server 1?
2. Are you saying that since I have backup servers I don't need check for this in my code? My order is only sent on Bar Close, so if there is enough of a delay, then the new bar will start and the code will skip the trade. Since these trades can go on for days, I would miss a critical entry / exit.

If I do check for this, should I create a recurring loop till the result = 0?
Is this the right approach?

if (Buy == true)
{
do
{
Result = sc.BuyEntry(NewOrder);
}while (Result != 0)
}
[2019-06-19 03:18:05]
Sierra Chart Engineering - Posts: 104368
Use:
Primary = Server 2
Backup 1 = Server 1
Backup 2 = Server 4

Definitely do not put a loop like that!!! For more information about error handling, refer to:
Automated Trading From an Advanced Custom Study: SCTRADING_ORDER_ERROR
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: 2019-06-19 03:18:53
[2019-06-20 01:25:47]
rahul - Posts: 160
Thanks for the server configuration.

Regarding the error handling, I will check if Result > 0 is true, then proceed to set flags = true in my code. If Result = SCTRADING_ORDER_ERROR, then flag = false (reset all variables to 1 bar back value, and don't copy over current bar value as trade didn't execute).

I use to flags to check if I am already in the trade

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

Login

Login Page - Create Account