Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 18:50:54 +0000



[Programming Help] - Shared dll file

View Count: 343

[2023-04-05 23:44:20]
Tahir - Posts: 35
Hi,
I have a study that I share through sierra distribution that calculates trade statistics for backtesting.
It works great on my machine but when others use the file the calculations reset to 0 everytime they change any input in the study. So they have to remove the study, re apply it with the desired input.
Is there an obvious reason why this could be? Could it be anything to do with the distribution?
I cannot share the sourcecode, unfortunately.
Thank you
[2023-04-07 15:20:33]
ondafringe - Posts: 286
Here's my take:

Whenever you change a study's input, what typically happens is the study will do a quick recalculation starting all the way back from the very first bar loaded in your chart. However, from what I've seen, on a quick recalc like that, there is no intra-bar processing. The study only makes one pass through the code for each bar and that pass is all-inclusive: it takes into account all the trading hours for that symbol for the entire 24 hour day.

Again, from what I've seen, what *should* happen when your study's input is changed is, your calculation totals, at that point, would be retained, BUT... all the single-pass recalculation totals for each bar, from the very first bar, would be added to your retained totals, which could/would give you some pretty hyper-inflated totals.

You indicate the study is performing as expected on your system, but how do you know the totals you're looking at aren't hyper-inflated? Have you used the Visual Studio debugger to check? If you aren't using Visual Studio and don't have access to the debugger, then you're flying blind, and trying to find/fix problems in your code will be a nightmare and, in some cases, maybe even impossible.

As for others using your study, do you have access to their system? If not, how do you know their calculations are being reset to 0? Is the end result 0, or are they simply seeing different totals after a recalc?

If I'm off on any of that, maybe someone at SC will set me straight.
[2023-04-07 18:32:16]
Tahir - Posts: 35
thank you for the answer.

I actually found out whats going on. It was because they had evening session turned off on their chart.
my study is wrapped around if (sc.Index == 0) because I don't want it to update live. I can see that when you turn off evening session bar numbering continuation resets, so I'm guessing its something to do with that.

Any ideas how to get around the issue?
[2023-04-08 01:17:38]
ondafringe - Posts: 286
An sc.Index of 0 is the very first bar of the chart, all the way back at the beginning of how ever much data you have loaded in your chart.

I have no idea what you are trying to do.
Date Time Of Last Edit: 2023-04-08 02:13:18

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

Login

Login Page - Create Account