Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on Calling OnBarUpDate

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

    Error on Calling OnBarUpDate

    2016-11-27 18:43:34:111 ERROR: Indicator 'ThreeBarReversal': Error on calling 'OnBarUpdate' method on bar 7: The calling thread cannot access this object because a different thread owns it.

    This is a very simple indicator. I made a minor change and the preset started generating exceptions. I could not get rid of the error. I even comment out "ALL" the code and it still gave me the error. So I renamed it, That got rid of the error. I Spent the afternoon. Line by line adding the code back and renaming each time it gave me an Error. Finally it came down to the colors in my properties dialog which always worked. So I commented that out and got it running. Now it started giving me this error. The code is too simple. Not including setting defaults it is only 6 lines of code.

    Jerry

    #2
    Hello JerryWar,

    Thank you for your post.

    Is this an indicator we may test? If so, please attach the indicator found under Documents\NinjaTrader 8\bin\Custom\Indicators to an email to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread in the body of the email.

    If not, can you detail if you are accessing any items that may be upon another thread?
    Are there are Brushes or Strokes that are being created in OnBarUpdate() or in OnStateChange?
    Have you reviewed the considerations for Multi-Threading in NinjaScript? - http://ninjatrader.com/support/helpG...-threading.htm

    Comment


      #3
      Patrick
      This was a simple indicator. Simple Simple Simple. It was not the indicator, When I got so frazzelled I didn't know which end was up I generated it using the Wizard. It still gave me an error. No Multi Time frames in this one. I got it working by deleting the chart and recreating a new one. This kind of corruption is happening over and over. It has not generated any errors again. It was not the indicator. Ninja Just kept telling me it was. I will send you the code.

      Jerry

      Comment


        #4
        Hello JerryWar,

        Thank you for your patience.

        You would need to freeze the brush in order to use it, otherwise you will see threading issues arise. Please refer to the following link for more information: http://ninjatrader.com/support/helpG...gcustombrushes

        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