Support Board
Date/Time: Sun, 24 Nov 2024 15:30:50 +0000
Inconsistent Execution from Trading Systems/Alert Condition Study
View Count: 418
[2024-05-09 15:43:29] |
TraderBiku - Posts: 36 |
Hello, I am encountering some difficulties getting the Trading System based on Alert Condition Study to execute consistently, and I'm having a hard time isolating the issue. I have an instance of the study that has a fairly simple piece of code that I wrote in it, and when I leave the study "Enabled" it seems to execute this code properly. However, my desired functionality is to use the ACS Control Bar Button Enable/Disable system to turn the Study "On/Off" during the course of the session. I find that when I do this, I get very inconsistent execution results, and that the study frequently does not execute the next trigger(s) properly after I turn the system "On". This seems to be especially true if I turn the system "On" DURING the formation of the bar that eventually becomes the "trigger" bar as per the custom code in the study. I have the Trading System study set to "Evaluate On Bar Close" so my assumption would be that turning the study "On" after the trigger bar starts forming, but before it closes would not be an issue - is this an incorrect assumption? I also find that I get different results if I try to replay the same sequence in replay compared to live (I am using the Trading Evaluator data feed for both replay and live). I have scoured the Trade Service Log for errors, but cannot find anything that seems related to why the signal isn't firing. I occasionally see a statement saying "Trading is not allowed, Reason: Formula state has not changed" but this cannot be true because the Trading Study is printing a marker on the bar showing that the formula is "True" for that bar, and the prior bar is not "True"; I also have the "Reset Alert Condition on New Bar" function enabled on the Trading Systems study, in an attempt to address this message. In short, the only time I seem to get the expected results for the study is when I leave it "Enabled" for long periods of time, but my wish is to be able to Enable and Disable it in real time, and ideally DURING the formation of the bar that will eventually become the "trigger" bar for the code in the study. Please let me know if I can clarify the issue further - thank you. Date Time Of Last Edit: 2024-05-09 15:45:02
|
[2024-05-09 16:28:10] |
John - SC Support - Posts: 36238 |
We really can not say what is occurring. Our only recommendation is to start with a simple Alert Condition and make sure everything is working as you expect. If you can get this to work, then it would have to be something about the condition you are setting up that is causing the issue.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-05-09 16:37:40] |
TraderBiku - Posts: 36 |
Thanks John - I have a Color Bar/Alert Condition study set up so I can cross-reference it with the Trading Systems study - the code is identical in both studies so I'm able to monitor when the condition is met - the code is working as expected on the Color Bar study. Can you confirm that in principle Enabling the Trading System study after the trigger bar starts to form but before it closes should still give an entry signal on the Trading Systems study? I do not have the Color Bar/Alert Condition set to "Evaluate on Bar Close" so I can at times see that the condition is already "True" intra-bar before I turn the Trading Systems study on - however, since I have the Trading Systems study set to "Evaluate on Bar Close" I would assume this would not be an issue - can you confirm this as well? Lastly, there are some cases where there are two (or more) consecutive trigger bars - can you confirm that the "Reset Alert Condition on New Bar" function should create a fresh "False" signal for the 2nd bar in the sequence, meaning it could re-fire as "True" if the condition is met before that bar closes? Date Time Of Last Edit: 2024-05-09 16:41:38
|
[2024-05-09 18:02:46] |
TraderBiku - Posts: 36 |
A follow-up on my end, I reviewed the sequences from today to see where the Trading System study worked vs. when it didn't work - I have both the Color Bar/Alert Condition and Trading System/Alert Condition giving me markers on the chart, I can confirm that both systems gave markers on the trigger bars in question, and still no trade was initiated. Even stranger, there is nothing in the Trading Services Log about this event (ie no information about why the trade wasn't initiated). Am I to understand this study is simply not reliable? Or are there more places I should be looking for information? |
[2024-05-09 18:05:58] |
John - SC Support - Posts: 36238 |
Can you confirm that in principle Enabling the Trading System study after the trigger bar starts to form but before it closes should still give an entry signal on the Trading Systems study?
This really has nothing to do with whether the condition is met or not. This is only setting the study to allow for trading at the time you "Enable" it. And since you have the option for "Evaluate on Bar Close" enabled, then the only time that matters is the state at the close of the bar. I do not have the Color Bar/Alert Condition set to "Evaluate on Bar Close" so I can at times see that the condition is already "True" intra-bar before I turn the Trading Systems study on - however, since I have the Trading Systems study set to "Evaluate on Bar Close" I would assume this would not be an issue - can you confirm this as well?
If the "Color Bar on Alert Condition" is not set to "Evaluate on Bar Close" then this is a different situation from what you are doing in the Trading System. Evaluate on Bar Close means that the condition will not be tested until the bar is closed, and all the conditions have to be met at that point. They can not have been met while the bar is forming and then later not be true. It only matters when the bar closes. Lastly, there are some cases where there are two (or more) consecutive trigger bars - can you confirm that the "Reset Alert Condition on New Bar" function should create a fresh "False" signal for the 2nd bar in the sequence, meaning it could re-fire as "True" if the condition is met before that bar closes?
Yes, "Reset Alert Condition On New Bar" will reset the alert. But keep in mind, you also have to have the Input for "Allow Multiple Entries in the Same Direction" set to "Yes" in order to actually get additional orders sent through when the condition is met and you already have an open position. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-05-09 20:58:08] |
TraderBiku - Posts: 36 |
Thanks John, that is helpful information. Here is a more detailed example and explanation of what is happening repeatedly, including the available message logs. In the first image, the bar with the large white arrow (bar time 21:50:00) has a blue triangle (generated by the Color Bar By Alert Condition study) and a green circle, generated by the Trading System by Alert Study - both of them have identical code, and as you can see, both are "True" at the time of bar close, 21:50:58. This second image is is a screen shot taken 13 seconds later of the alerts log (left) and the trading services log (right); the alerts log shows that the Trading System studied fired a "True" signal at the bar close 21:50:58, and still no trade was initiated. Meanwhile at the same time, the Trade Service Log shows no indication of why this signal has not been processed. There are no further messages in the Message Log either; the Trading System study is set to send trade orders to trade service and I am using Trading Evaluator on live market data. I would appreciate any further insight you can offer into this matter, as I believe I have pretty throughly exhausted the available options I can think of. Thank you - |
Screenshot 2024-05-09 at 10.38.40 PM.png / V - Attached On 2024-05-09 20:56:55 UTC - Size: 409.36 KB - 66 views Attachment Deleted. Screenshot 2024-05-09 at 9.51.11 PM.png / V - Attached On 2024-05-09 20:57:20 UTC - Size: 1.57 MB - 59 views |
[2024-05-09 21:07:49] |
John - SC Support - Posts: 36238 |
Please get us your chartbook so we can take a look. Let us know what chart number has the trading system on it. Follow these instructions to get us your Chartbook: https://www.sierrachart.com/index.php?page=PostingInformation.php#AttachFile For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-05-09 22:58:45] |
TraderBiku - Posts: 36 |
Thanks John, I appreciate you having a look. I've uploaded the chartbook, the Trading System/Alert Condition studies are on Chart #7 - there is a long and short trigger, ID44 and ID48, both of which are connected to ACS hotkeys - I only ever operate them one at a time. The chartbook also has tick size 0.5 (instead of the default 0.25 for NQ) - this setting seems to get lost when loading on a new instance, and affects the triggers as they are based on Range. For clarity, these triggers sometimes work, but I would say more often than not they do not work, especially when I use the ACS hotkey to Enable them during the formation of the trigger bar. When I leave them on for longer periods, they seem to work more consistently. Please let me know if you need any more information. Thank you - Date Time Of Last Edit: 2024-05-09 23:00:46
|
Private File |
[2024-05-13 20:57:32] |
John - SC Support - Posts: 36238 |
We are sorry we have not had time to look into this yet. Hopefully we will be able to get to it in the next couple of days.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-05-15 22:16:06] |
John - SC Support - Posts: 36238 |
Everything is working properly for us in the chart, with a few tweaks. But here are a few items of note: 1*. We moved the Trading System Based on Alert Condition studies to the bottom of the list of studies. Since there is a dependency on the Numbers Bars Calculated Values, it needs to be lower in the list than the studies on which it depends. Putting it at the bottom is safest. This is the most important item. 2. We removed all the other extraneous studies. We do not think this will have any impact, but given how many studies you have on the chart, and how you only really need a couple for the trading system, we would recommend offloading everything that you do not need. It could be causing a longer time for the study to get calculated and create some kind of timing issue. Again, we do not think so, but best to start simple and go from there. 3. We only tested in replay. We do not think it will make any difference, but just so you are aware. We did not have any issue with Enabling the Trading System within a bar after the condition is true. It would properly place the trade when the bar closed as long as the condition was true at bar close. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-05-17 01:19:40] |
TraderBiku - Posts: 36 |
Thanks John, I appreciate you looking into it - I will make those changes and hopefully will be able to replicate your results! I will report back either way. Thanks again.
Date Time Of Last Edit: 2024-05-17 01:19:50
|
To post a message in this thread, you need to log in with your Sierra Chart account: