Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 12:39:59 +0000



Automated Trading System - Trade executing one bar late

View Count: 2085

[2016-02-05 13:59:35]
rhovega - Posts: 279
Hello SC,

I have spent hours in the following issue and can't find the answer.

I am using Automated Trading System, testing on replay, on one chart only, using Accurate Trading System Back Test Mode. The Automated Trading System not evaluating on bar close. Trade execution happens one bar after the signal.

Example (Chart is 1 minute bars):

09:59 Conditions are true; based on Color Bar Based on Alert Condition, set to Evaluate on Close, hence conditions take place at 9:59 and become true at 10:00:00
10:00:00 Alert condition = TRUE; populates a number in the spreadsheet at 10:00:00; trade arrow prints
10:01:00 Trade executes

Could you please help with this?

Thanks
[2016-02-05 17:49:48]
rhovega - Posts: 279
Watched some replies at x0.1 speed to better identify the timing problem.

The sequence is as follows:

bar1: at bar close, trigger signal prints on chart
bar2: at bar close, trigger signal records a "1" on spreadsheet, and an arrow on chart
bar3: at bar open, trade executes

So the question is, why are signals recorded on the spreadsheet system 1 bar too late?
Can you help please? Would assume this is something many other users go / have gone through.

Thank you
[2016-02-05 17:52:13]
rhovega - Posts: 279
Subject of support request should be "Automated Trading System - Signals recorded one bar late".

I have of course gone through this http://www.sierrachart.com/index.php?page=doc/doc_SystemsAlerts.php countless times.
[2016-02-05 18:27:42]
rhovega - Posts: 279
If the trigger study, which in this case is "Color Bar Based on Alert Condition", is NOT set to "Evaluate on bar close", then "Color Bar Based on Alert Condition" prints on the chart at the same time as it records a "1" on the spreadsheet, and the trade executes without problem.

The problem is when the trigger study, "Color Bar Based on Alert Condition", is set to "Evaluate on bar close". Then, as detailed on post #2, it doesn't record a "1" on bar close, but rather at the close of the following bar (i.e. one bar late).

Hope this is clear.
[2016-02-05 22:05:35]
Sierra Chart Engineering - Posts: 104368
Refer to:
https://www.sierrachart.com/index.php?page=doc/doc_AutoTradeManagment.php#TroubleshootingAutoTradingSystemBehavior

And:
https://www.sierrachart.com/index.php?page=doc/doc_SystemsAlerts.php#IgnoredSignals

What we get from this, is you cannot make an assumption that when you see a 1/TRUE in a cell that at the moment the cell was evaluated for an order signal that the 1 was present at that time. It may have been 0 and maybe quickly went to 1 after.
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: 2016-02-05 22:07:26
[2016-02-06 00:32:59]
rhovega - Posts: 279
There are no assumptions here. The issue/behavior I described happens with the most simple conditions that leave absolutely no room for doubt, such as the "High of a bar being greater than a moving average". At the moment a cell is evaluated on bar close, Sierra Charts records a condition that is true (i.e. High of a bar being greater than a moving average) only as true at bar close, briefly, then replaces the true condition for a 0 immediately, and then re-registers the condition as true at the close of the following bar. Once the High of a bar is greater than X, it is greater than X permanently. Thus, the condition should remain recorded as true permanently. The condition should not appear and disappear. This results in trade execution two bars after the signal took place, instead of at bar close. This is basic Sierra Charts functionality. No coding here. Signals are not properly recorded when true. Or to be more precise, signals are recorded when true only briefly, and then recorded as true one bar late. Why does this happen? What is the solution?

I am attaching a screenshot and a seconds long video showing a replay with the example of "High of a bar being greater than a moving average". Both the screenshot and the video show the problem very clearly. Can also attach a bare bones chart if needed.

I need support with basic Sierra Charts functionality regarding unexpected behavior of true/false conditions that do not register correctly. We are not Troubleshooting Automated Trading System Behavior.
imageScreenshot.jpg / V - Attached On 2016-02-06 00:30:49 UTC - Size: 444.69 KB - 375 views
Private File
[2016-02-06 01:26:40]
rhovega - Posts: 279
I truly do not care why Sierra Charts does not register signals correctly (as shown above).

What I need to know is how to get a TRUE condition to execute a trade at the open of the subsequent bar.

My experience is Sierra Chart, after a TRUE condition, executes trades at the open of two subsequent bars (if using "evaluate on close" or "signal only on bar close" or referencing manually row @4) or at the moment the condition is registered before bar close (if not using bar on close). As shown above this is for any signal Sierra produces, even one based on a condition as simple as "High of bar > X". I can't find the in between. I need the in between. Is this asking too much?
[2016-02-06 01:50:45]
Sierra Chart Engineering - Posts: 104368
The video you provided stops at 22 seconds. But it appears to be longer than that.

What you are doing does raises some questions to us of things we need to look into and we are examining that.

There is also a potential precedence issue. Your Color Bar study must be above the Spreadsheet Study in the list of studies.
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
[2016-02-06 18:16:06]
rhovega - Posts: 279
Video is 46 seconds long. Re-attaching.
Private File
[2016-02-06 18:20:10]
rhovega - Posts: 279
Moving the Spreadsheet Study to the bottom of the list of studies solved the problem. Before the studies order was 1. Trading System. 2. Moving Average 3. Color Bar. After moving the Trading System below signals record properly, and trade execution using bar on close takes place at the open of the bar following signal. All good. Thanks. You may want to make a note of this in your Spreadsheet system / Trading system documentation.
[2016-02-06 18:28:15]
Sierra Chart Engineering - Posts: 104368
We have looked into this, and the problem is a study calculation precedence issue:
https://www.sierrachart.com/index.php?page=doc/doc_ChartStudies.html#StudyCalculationPrecedence


As we said the Color Bar study must be above the Spreadsheet System for Trading study and you cannot use any other Spreadsheet study other than the Spreadsheet System for Trading study.

We need to make it clear as to what the calculation precedence is for these studies. It may already be but we need to review this.

So as you can see, you are making what you are doing complicated by involving the Color Bar Based on Alert Condition study when you should just be doing everything within the spreadsheet formulas.
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
[2016-02-09 17:17:14]
rhovega - Posts: 279
More complicated, true, but spreadsheet studies with more than 500 rows can significantly slow down a chart (in my case chart stutters every Y seconds), while with the Color Bar Based on Alert Condition one can have tens of thousands of signals without performance issues (do have a massive desktop, not the issue, just talking about relative CPU needs).

Thanks.
[2016-02-09 18:05:22]
Sierra Chart Engineering - Posts: 104368
We have made significant performance improvements with New Spreadsheets over the last month with the most recent updates in the last two weeks. Update to the current version of Sierra Chart. Here are instructions:
https://www.sierrachart.com/index.php?page=doc/download.php#FastUpdate
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: 2016-02-12 23:17:56
[2016-02-12 22:45:04]
rhovega - Posts: 279
It seems using an ACSIL based trading system would be considerably better than using the Spreadsheet System for Trading (as more flexible and faster replay performance).

I currently have my signals written in two forms: as separate Color Bar Based on Alert Condition studies, and within the Spreadsheet System for Trading.

Any benefit of writing the signals each as a separate custom study (like custom Color Bar Based on Alert Condition studies) and creating a custom trading study with entry/exit rules referencing those studies vs making a custom trading study referencing Color Bar Based on Alert Condition studies? Would replay performance be any slower if the custom trading study makes reference to Color Bar Based on Alert Condition studies?

Thank you
Date Time Of Last Edit: 2016-02-12 22:47:44
[2016-02-12 22:54:37]
Sierra Chart Engineering - Posts: 104368
We are not understanding this question. Your question is asking the same thing twice.

And also, we do not know what the performance impact would be.

You really need to do your own testing and come to your own conclusions here. That is going to be the best way.
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: 2016-02-12 22:55:34
[2016-02-12 22:55:28]
rhovega - Posts: 279
Could an ACSIL based trading system, besides of having the entry/exit orders, create a spreadsheet where to keep a summary of conditions and trade statistics? (like the information/statistics that Spreadsheet System for Trading keeps in columns I and J). If possible, would assume this would not affect performance negatively. Correct?
[2016-02-12 22:56:43]
Sierra Chart Engineering - Posts: 104368
Regarding post #16 ACSIL cannot do what you want.
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
[2016-02-12 23:01:10]
rhovega - Posts: 279
Yes, indeed I asked the same question twice on post 14.

Point was, you had previously recommended to not use Color Bar Based on Alert Condition studies for trading signals, said that by doing so I was just making things complicated, and to better put all signals within the Spreadsheet System for Trading. Now, if I am using a custom trading study, I don't see any issues with using Color Bar Based on Alert Condition studies as I was originally doing. Does this make sense?
[2016-02-12 23:07:22]
rhovega - Posts: 279
Apologies if this is too basic. Its just that the performance of replays using accurate trading system back test mode with the Spreadsheet System for Trading is dismal. So it seems I need to explore a move to ACSIL. Currently replaying one day of data at x1440 speed does not take one minute (as math would make one expect), but rather one full hour.
[2016-02-12 23:16:03]
Sierra Chart Engineering - Posts: 104368
You have disregarded us on this issue. We told you to update but yet you did not.

Refer to post #13.
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: 2016-02-12 23:16:14
[2016-02-13 02:41:44]
rhovega - Posts: 279
Version 1354 took one hour to replay one day at speed 1440x (instead of 1 minute).
Version 1369 took eight minutes to replay one day at speed 1440x (instead of 1 minute).

Fantastic improvement. Thank you. It still is 8x slower than it should be.

Now would you care to answer post #18? Would there be performance benefits in using a custom study that replicates Color Bar Based on Alert Condition vs using Color Bar Based on Alert Condition? You had previously advised against using Color Bar Based on Alert Condition.
[2016-02-13 02:51:55]
Sierra Chart Engineering - Posts: 104368
Yes most likely there would be a performance benefit to this:

Now would you care to answer post #18? Would there be performance benefits in using a custom study that replicates Color Bar Based on Alert Condition vs using Color Bar Based on Alert Condition? You had previously advised against using Color Bar Based on Alert Condition.

Although we do not know to what extent. It could be small.
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: 2016-02-13 02:53:07
[2016-03-05 16:43:57]
rhovega - Posts: 279
Moved all to ACSIL. Impressive backtesting speed difference vs spreadsheets. Getting true speed (x11520) now (an 8x improvement). Replay freezes every now and then, at any speed, for a few seconds (with Skip Empty Periods selected). Just as it did with spreadsheets. Don't see any pattern on the freezing. Not asking for support on this, sure you are aware of it.
[2016-03-06 21:57:28]
Sierra Chart Engineering - Posts: 104368
Freezing is not unusual at high speeds or when using Accurate Trading System Back Test Mode.
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