Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 02:27:28 +0000



[Programming Help] - DLL vs Spreadsheet speed of execution

View Count: 1506

[2019-07-19 17:50:00]
John M - Posts: 166
Hello,

Let's say I have an alert that is Evaluate on Close that triggers a trade entry.
Ex: ID1.SG1@3>0

With this in the spreadsheet it makes the trade wait an additional cell later to happen rather than the immediate next cell.

Does this same delay occur with the same function done in ASCIL / DLL coding?
[2019-07-20 07:43:11]
Sierra Chart Engineering - Posts: 104368
It should be the immediate next cell. What happens is that row 4 is what is being evaluated :
Spreadsheet Systems, Alerts and Automated Trading: Signal Only on Bar Close
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-07-21 18:17:04]
John M - Posts: 166
Ok, it doesn't seem to be immediate when doing live trading but does in playback testing. Live trading seems to be delayed one period. I am using flex renko bars 10-7-0 in this particular chart.

If I have evaluate on close in the spreadsheet/trading parameters in addition to evaluate on close in the alert does that introduce another delay?
[2019-07-22 00:11:14]
John M - Posts: 166
Ok, I am running live automated trading but with trading locked so it doesn't fire off the trade.
On the 10-7-0 flex renko chart, the alert signal appears in the bar at 17:33:27 which has an Evaluate on Close color bar alert. The trade should have fired on the next bar to appear after that signal. The next bar appeared at 18:01:52 but the Trade Service Log doesn't show the Trading Locked error until 18:36:46 when it finally tried to do the trade which is the appearance of the 2nd renko bar after the alert signal.

What is going on ???

The spreadsheet page with the formulas is Sheet 10. Is this part of the problem?

I do not see this issue happening when running in trade simulation back testing so I am a bit flummoxed.
[2019-07-24 03:04:55]
Sierra Chart Engineering - Posts: 104368

If I have evaluate on close in the spreadsheet/trading parameters in addition to evaluate on close in the alert does that introduce another delay?
No. We have verified this. It is not even used when the Spreadsheet System/Alert Study is being used.
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-07-24 03:33:17]
Sierra Chart Engineering - Posts: 104368
but with trading locked so it doesn't fire off the trade.
How are you locking the trading?

What is going on ???
Refer to:
Automated Trading Management: Troubleshooting Automated Trading System Behavior


The spreadsheet page with the formulas is Sheet 10. Is this part of the problem?
No.
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-07-24 03:33:36
[2019-07-24 08:55:02]
John M - Posts: 166
Trading is locked via the Trade Menu>>Trading Locked selection.
- - - - - -
This is a very simple Alert being used,
=CROSSFROMABOVE(ID18.SG1,ID19.SG1)to create a Color Bar Alert ID14.SG1

=ID14.SG1@3>0 is entered in cell M3 for Sell Entry

The Color Bar Alert is set to -Evaluate on Close-. The Alert appears under the correct conditions, the trade arrow appears under the Alert indicator (Diamond) but the trade entry is not on the next bar but on the second bar after the alert.
[2019-07-24 09:03:37]
John M - Posts: 166
http://www.sierrachart.com/image.php?Image=1563958899813.png


Here is the screenshot of the above


Your assistance is greatly appreciated.
[2019-07-24 10:08:14]
Sierra Chart Engineering - Posts: 104368
Trading is locked via the Trade Menu>>Trading Locked selection.
If trading is locked there, there can be no trading. There simply is no other possibility.

Your explanation only exemplifies what we say here:
Automated Trading Management: Troubleshooting Automated Trading System Behavior

The Color Bar Alert is set to -Evaluate on Close-.
Yes, this might be relevant but that requires careful analysis. There was no way we could possibly have known that because we do not know what you were doing with all of the configuration.


There is no way we could have ever had an understanding about this. The responsibility to debug this is with you. Also consider the possibility of calculation order issues. We do not provide automated trading system debugging. This is your responsibility.

We are marking this as programming help.
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-07-24 11:26:28
[2019-07-24 13:20:20]
Sawtooth - Posts: 4000
You could bypass the color bar output and instead directly use the spreadsheet's syntax for the signal in M3:
=CROSSFROMABOVE(ID18.SG1@3:ID18.SG1@4,ID19.SG1@3:ID19.SG1@4)
[2019-07-24 13:39:33]
John M - Posts: 166
Will bypassing the color bar output change the delay in the trade executing so it executes on the next bar after the signal?

Or does Evaluate on Close simply imply that the trade will always be two bars after the signal?

thanks!
[2019-07-24 13:58:16]
Sawtooth - Posts: 4000
Will bypassing the color bar output change the delay in the trade executing so it executes on the next bar after the signal?
It should. At least, give it a try. If it doesn't, there are other issues.

Or does Evaluate on Close simply imply that the trade will always be two bars after the signal?
No. The Spreadsheet System for Trading study, when 'Signal Only On Bar Close' is set to Yes, will look for a signal at the open of Row 4.
Spreadsheet Systems, Alerts and Automated Trading: Signal Only on Bar Close
[2019-07-24 14:17:41]
John M - Posts: 166
As simple as this Alert is, what else could there be?
Would something amiss in the preferences in the Spreadsheet for Trading cause this and if so, what parameter(s) ?
[2019-07-24 14:46:11]
Sawtooth - Posts: 4000
As simple as this Alert is, what else could there be?
If using a direct formula on the spreadsheet solves the delay issue, you might not care what causes the delay when using the color bar's output.
At any rate, this would be a good first step in isolating the problem.

When you say the delay is only seen in live trading, which applies?:
- Are you forward testing in SC sim using live data?
- Are you trading live to your broker's sim account?
- Are you trading live to your broker's live account?

Does the late signal occur intrabar in row 4, or always at the close of row 4?
Check the Trade Activity log for the exact entry time compared to the bar's timestamp.

Would something amiss in the preferences in the Spreadsheet for Trading cause this and if so, what parameter(s) ?
It's doubtful it's related to spreadsheet study settings. What you are experiencing is not expected behavior.
[2019-07-24 15:25:56]
bradh - Posts: 859
If the Spreadsheet Study CalcOrder is before (lower than) the Alert Study's CalcOrder, then it will cause a delay in the Alert going to the spreadsheet. Usually, this is not an issue, as the CalcOrder should place spreadsheets after all others, but it is worth checking.
[2019-07-24 17:11:51]
John M - Posts: 166
Ok, let me be clear about what's happening:

In ->live trading<-, with an Alert that is Evaluate on Close, rather than entering the trade on the next bar it enters two bars later. This is with live data from the Sierra Charts feed.

I have seen this is back testing in simulation.

This is a very simple Alert that requires Evaluate on Close so it does not execute with premature false triggers. It is a very simple CROSSFROMABOVE or CROSSFROMBELOW alert, nothing complex.

Calc Order is fine. Version 1919 32 bit (27088:27089M)
[2019-07-24 18:10:35]
bradh - Posts: 859
Have you tried a more current version? 1919 is from two months ago. Sierra is up to 1957, but if you are with Transact, then the highest you can go is 1941.
[2019-07-24 18:23:55]
John M - Posts: 166
No I haven't, it shouldn't make any difference in something this simple and the updates appear to change the graphics to a state that I don't like.
[2019-07-24 18:27:46]
John M - Posts: 166
and I just updated to the current version, let's see what happens.
[2019-07-25 00:24:02]
John M - Posts: 166
Many thanks to tomgilb who helped me sort this out.

It's alive!

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

Login

Login Page - Create Account