Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

questions about processing OnBarUpdate logic in external classes

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

    questions about processing OnBarUpdate logic in external classes

    Hi,

    I a creating many classes which delegate calculations for my indicator. Each of these classes process logic by having a "TickTock" method that is called by the OnBarUpdate() event.

    I notice sometimes that my indicator doesn't paint consistently unless I do a reload all historical data.

    So, I was wondering if I should be calling the Update() method in these classes or not.

    I tried to do this in the object, by passing a cast Indicator into the object. Then at the end of the TickTock method, I would call Indicator.Update(). But i need the signature Update (int idx, int bip). In the help, these paramaters are not mentioned.

    Anyways, I am not sure if i am following the right path, to try to call the Update method, but regardless, I cant seem to figure out how to call it in a class.

    Any suggestions are appreciated.

    Thank you in advance.

    #2
    i discovered that there were errors when the indicator was accessing a text file that contained TTS text to be read during alerts, as it couldnt find the file. I am not sure if this was the cause of the problem or not.

    The problem is basically that real-time data is showing different indicator values than historic. So during the trading day it will show setups that appear realtime, but if i reload the data, it shows different setups. I am wondering what the cause of this could be, as I dont want to conitnually have to manually refresh my historic data to get valid setups.

    Perhaps an unhandled error could corrupt things somehow, and cause errors in the indicator. When my indicator loads historic data, it wont fire the Text to speech and therefore didnt call the readtext method for a file that didnt exist. So I wonder if this could be the problem. I have fixed this bug in the code, so I will test it on monday, but again, perhaps this is not the cause of the problem.. if you have any ideas let me know please.

    Comment


      #3
      Hello KhaosTrader,

      Thank you for your post.

      As Historical data is the closed bar of the selected type there are no intra-bar movements calculated. In Realtime data we have each tick as it comes in.

      The above can affect the behavior of what values are set if we are expecting multiple events per bar, which would not occur historically.

      I would run through the code and see if any items that would set your plot series or data series values would be different intra-bar versus only on the close of the bar.

      Comment


        #4
        Hi,

        I reworked the code so that it will only execute when IsFirstTickofBar == true. I will test it tomarrow and see how it goes.. and let you know..

        Thank you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, Yesterday, 03:01 PM
        3 responses
        29 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        4 responses
        25 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Brevo, Today, 01:45 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by rjbtrade1, 11-30-2023, 04:38 PM
        2 responses
        74 views
        0 likes
        Last Post DavidHP
        by DavidHP
         
        Started by suroot, 04-10-2017, 02:18 AM
        5 responses
        3,022 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X