Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 00:34:48 +0000



It would be great to have few ACSIL improvements in the Replay management space

View Count: 1681

[2019-11-27 15:39:59]
User972768 - Posts: 166
Hello,

I'm building environment for backtesting multiple instruments in parallel. I believe ACSIL could be improved a bit in this area. Here is what would be great to have as standard ACSIL functions:

1) Test replay status in specific chart. My current workaround for this missing functionality is to check chart name for "Replay" string presence. It is not as elegant as something like sc.ChartReplayStatus(ChartNumber) would be

2) Allow to start multiple replays via ACSIL with option to skip empty periods

3) There is a typo in the documentation of the sc.GetChartName(). It doesn't return int value.

Thank you very much and Best regards
[2019-12-20 07:27:04]
Sierra Chart Engineering - Posts: 104368
We apologize for the delay. We are looking this over.

1. We can do this.

3. We will check this. We think we already corrected this.
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
[2019-12-20 14:14:37]
User972768 - Posts: 166
1. Thank you for accepting this request.

2. Would really speed up back tests of stocks as they trade only small portion of the 24-hour period. Hence most of the time backtest sits and doing nothing while emulated time goes through the "between the sessions emulated overnight period".

3. The typo in documentation of sc.GetChartName is still present in function signature. Example shows correct use of the function.

Thanks
[2019-12-20 18:38:07]
Ackin - Posts: 1865
+1 to (2)
[2019-12-31 11:37:13]
jmt816 - Posts: 45
if i may piggyback on to this thread re: replay enhancements. Currently, ASCIL lets you CHANGE the replay speed, but not GET the replay speed.
requesting addition of a sc.GetReplaySpeed function
[2020-03-30 05:14:00]
Sierra Chart Engineering - Posts: 104368
Why would you need to get the replay speed? If ACSIL is starting a replay, remember what the speed was that you specified in a persistent variable.

2. Would really speed up back tests of stocks as they trade only small portion of the 24-hour period. Hence most of the time backtest sits and doing nothing while emulated time goes through the "between the sessions emulated overnight period".
We added a new replay function to support more parameters and one of them is to skip empty periods: sc.StartChartReplayNew

3. The typo in documentation of sc.GetChartName is still present in function signature. Example shows correct use of the function.
This is now corrected.
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-03-30 05:14:08
[2020-03-30 10:48:44]
jmt816 - Posts: 45
Why would you need to get the replay speed? If ACSIL is starting a replay, remember what the speed was that you specified in a persistent variable

Kicking off backtesting is not necessarily done from within ASCIL, but manually, in order to run a backstest of a trading systems. Detailed logging slows down execution when running an extended high speed test (e.g., for a full futures contract period of several months), vs when the logging is useful for evaluating things during a slower speed test.
Therefore, being able to toggle certain logging within code based on replay speed would be handy. Starting a backtest is not necessarily triggered by ASCIL, therefore could not be stored in a persistent variable.

Currently, I wrote a function that gets the replay speed by parsing it from the name of the chart, because that gets added to the chartname by Sierra.
Since Sierra obviously "knows" the replay speed in order to be able to include in chartname, why not expose the "Getter" since there is already the "Setter"?
[2020-04-06 19:01:28]
Sierra Chart Engineering - Posts: 104368
Ok we understand, this function will be added to the next release.
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
[2020-05-22 13:01:39]
User864728 - Posts: 4
We added a new replay function to support more parameters and one of them is to skip empty periods: sc.StartChartReplayNew

Hello,

I tried to replace the older function sc.StartChartReplay with the new sc.StartChartReplayNew function in my code but I keep getting the following error when trying to compile the code:

***
error: invalid initialization of reference of type 'n_ACSIL::s_ChartReplayParameters&' from expression of type 'int'
sc.StartChartReplayNew(sc.ChartNumber, 1, sc.BaseDateTimeIn[0], 1, 4);
***

These are the parameters I am passing to the function:
sc.StartChartReplayNew(sc.ChartNumber, 1, sc.BaseDateTimeIn[0], 1, 4);

Can you advise what should be the correct parameters?

Thanks
[2020-05-22 13:33:22]
User907968 - Posts: 823
It tells you in the documentation and in your error message -
sc.StartChartReplayNew()

'n_ACSIL::s_ChartReplayParameters&' - a reference to a n_ACSIL::s_ChartReplayParameters structure
[2020-05-22 16:44:59]
User864728 - Posts: 4
Thanks, I did see that in the documentation but as I'm fairly new to programming I wasn't quite sure what to do with that information (I assumed/hoped the function would take parameters the same way sc.StartChartReplay does).

Anyway, figured it out now, so in case anyone ever needs this:


n_ACSIL::s_ChartReplayParameters ChartReplayParameters;

ChartReplayParameters.ChartNumber = 1;
ChartReplayParameters.ReplaySpeed = 100; //or whatever speed is required (max 100000)
ChartReplayParameters.StartDateTime = sc.BaseDateTimeIn[0];
ChartReplayParameters.SkipEmptyPeriods = 1;
ChartReplayParameters.ReplayMode = n_ACSIL::ChartReplayModeEnum::REPLAY_MODE_CALCULATE_SAME_AS_REAL_TIME;

sc.StartChartReplayNew(ChartReplayParameters);

[2020-05-23 11:03:40]
User972768 - Posts: 166
Dear Sierra Engineers,

Thank you for adding sc.StartChartReplayNew() to the ACSIL.

Could you please provide more details about differences between ReplayMode values of the n_ACSIL::s_ChartReplayParameters in the documentation?
It would be nice to have an example in the dedicated sections of the sc.StartChartReplay() / sc.StartChartReplayNew() too.

Thanks in advance
Date Time Of Last Edit: 2020-05-23 11:04:42
[2023-10-12 04:44:09]
j4ytr4der_ - Posts: 938
I was looking for exactly this today (with a couple minor modifications), and the code snippet from User864728 was helpful. However while the replay control panel pops up, the datetime is not set, skip empty values is not checked, and nothing else happens. Any input on why this would be?


  bool LoadingIsComplete = sc.IsChartDataLoadingCompleteForAllCharts();
  
  if(LoadingIsComplete == true){

    n_ACSIL::s_ChartReplayParameters ChartReplayParameters;

    ChartReplayParameters.ChartNumber = sc.ChartNumber;
    ChartReplayParameters.ReplaySpeed = 1; //or whatever speed is required (max 100000)
    ChartReplayParameters.StartDateTime = Input_One.GetDateTime();
    ChartReplayParameters.SkipEmptyPeriods = 1;
    ChartReplayParameters.ReplayMode = n_ACSIL::ChartReplayModeEnum::REPLAY_MODE_CALCULATE_AT_EVERY_TICK;
    ChartReplayParameters.ClearExistingTradeSimulationDataForSymbolAndTradeAccount = 0;

    sc.StartChartReplayNew(ChartReplayParameters);

  }

[2023-10-12 04:55:06]
j4ytr4der_ - Posts: 938
Whoops I was mistaken, a replay DID start but since it's set to pause at start, it looked like nothing happened.

So the code works, but there is a remaining problem. The supplied start date I'm feeding it, is not being inserted. Is there a trick required to send a datetime from a study input? This is my input:


    Input_One.Name = "Replay Start Date/Time";
    Input_One.SetDateTime(0);

And of course I've manually set it to my desired start date/time (this morning while I test this).
[2023-10-12 04:56:58]
j4ytr4der_ - Posts: 938
Aha... so it appears that the UI of the control panel simply doesn't change to reflect the supplied datetime. Replay is in fact working and starting from the specified datetime.

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

Login

Login Page - Create Account