Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Serious Bug in Indicators -> Parameter Update() causing synchronization issue!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Serious Bug in Indicators -> Parameter Update() causing synchronization issue!

    Hello,

    after over 4 hours of intense testing, I finally nailed down a serious bug in calling the Update() method within an indicator parameters.

    In order to make this easily reproduceable I have attached a complete sample, so you can see this in action. It is an indicator as well as a strategy which is using this indicator.

    For this demo -> the indicator is doing nothing but Printing the CurrentBar Number into the Output window to show its current Index. The indicator also has a public parameter e.g. price - the content of it is non relevant for this case. In order to access this parameter in a strategy we need to call Update() in the get accessor like we are used from NT7...

    Code:
    [Browsable(false)]		
    public double Price
    {
    	get { Update(); return price; }
    }
    The Update is required so that the indicator gets synchronized with the strategy.

    Now the strategy is using this indicator and retrieving the price in the OnBarUpdate. So far everything is fine... But now comes the serious issue.

    If the indicator is using an additional DataSeries and the strategy is calling the Price multiple times (like in the example) -> so it is calling the Update() method multiple times in one Strategies OnBarUpdate cycle, the indicator is going out of sync! You can see this in the Output window how the CurrentBar numbers are now different and how the time stamps don't align anymore!

    So there is a problem within the Update() method. Once there are additional DataSeries added to the indicator EACH time we call the Update() causes the indicators currentBar index to increase by 1 - thus going immeadently out of sync for all future calls from the strategy...

    I hope I could explain it enough so you can fix that pretty quick, otherwise feel free to ask - really a nasty bug and I can't do any backtesting at the moment due to this problem! Maybe I can make a workaround with some Series<T> object instead of the Update() - but since I have converted a strategy from NT7 to NT8 I wanted to keep it the same.

    Are there any license discounts for finding such evil bugs????

    Kind regards,
    Oliver

    P.S. used NT version is Beta12
    Attached Files
    Last edited by Lord Devil; 07-29-2016, 01:10 AM.

    #2
    Hello Lord Devil,

    Thank you for your detailed report and the scripts to recreate the matter.

    I can confirm this unexpected behavior and I will report to development.

    Please let me know if you have any additional items.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    41 views
    0 likes
    Last Post alifarahani  
    Working...
    X