Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 13:07:53 +0000



Possible Bug -- Executing Study from Wrong Chart?

View Count: 771

[2015-02-16 19:45:54]
Israel Gottlieb - Posts: 14
Dear Sierra,

Generally, I find the software fast & reliable. This one however, has given me a lot of headache -- please advise if it is a bug, or if I'm just not appreciating your intention.

I have a chartbook open that includes 2 charts for the same symbol. In chart1 I have a TradeSystem coded in ascil, in chart2 I have an ordinary study - also coded in ascil. Both log output lines to an external file (the same file). I've discovered that when I run a bar-based backtest on the tradeSystem of chart1, just before the very last simulation cycle, execution jumps to the study in chart2 -- for no apparent reason. The reason I caught this is because all the output from the backtest was being trashed just before the end, and I would see only output from the chart2 study. The study opens the file in truncate mode, while the TradeSystem opens it in append mode -- to accumulate output from all simulation cycles. When execution jumps to the study, the file is re-opened in trunc mode, and all the contents are discarded.

This is not speculation. I used the MSVC debugger and actually saw the exection happening in the chart2 study. I can trace execution exiting the TradeSystem code when sc.Index = BaseArraySize-1 for the 3rd time, i.e. after the 3rd of 4 backtest cycles, it then jumps to the entry point of the study in the other chart, completes execution there, and then returns to execute cycle #4 of the backtest for the same value of sc.Index. As far as I know, there's is no option in the SC API that supports a study jumping directly to another study -- so this is not happening in my code.

This phenomenon seems to occur only when both charts are loaded w/ the same symbol. It does not seem to matter in what order the charts appear in the chartbook, nor what chart number they have. Is this a bug? Or have I missed something?

Thanks for any help,
IG
[2015-02-17 01:25:11]
Sierra Chart Engineering - Posts: 104368
I've discovered that when I run a bar-based backtest on the tradeSystem of chart1, just before the very last simulation cycle, execution jumps to the study in chart2 -- for no apparent reason

This is because a bar based back test is not continuous. It has interruptions to allow the user interface to run. Other studies can be run during those interruptions if a chart requires updating.
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