• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reading volume information from Indicator

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

    Reading volume information from Indicator

    Hello
    Question: how I can read current volume value from Indicator sbClusterChart to my Strategy?
    Do you have any idea?


    #2
    Hello

    Thank you for the post.

    While it is possible for a strategy to request data from a indicators plot, this would ultimately depend if the indicator exposes that data. For this item, you would likely need to contact the developer of this indicator to find out if they have exposed the data you want as a plot. If so, you could certainly request that data from a strategy. You would likely also need to ask the developer of this item if any special syntax is required to call this indicator from a strategy,

    There can be certain cases where a developer does not expose the data and in that case you may not be able to access it.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesss for you answer!

      I have error in Log when I try to read any info from indicators with Tickreplay setting ON
      Error "Strategy 'MyCustomStrategy': Error on calling 'OnBarUpdate' method on bar 1: Index was outside the bounds of the array."

      How I can fix it?
      Thanks a lot

      Comment


        #4
        Hello sergey_z,

        Thank you for the reply.

        This would depend if you are running into a BarsAgo error, or an index in a collection being used. If the following instructions do not help, please provide a sample of the strategy for me to review and we could gather more details on what may be causing the error.

        Generally, this can be resolved by adding a check to prevent the script from processing until you have enough data. How much is enough data? A number of bars you are looking back is what would be required, so let's say that you have a 1 BarsAgo in your script: Close[1]
        You would need a check like the following:

        Code:
        protected override void OnBarUpdate()
        {
            if(CurrentBar < 1) return;
            Print(Close[1]);
        }
        This would just check if there is at least 1 bar, if so then continue the logic otherwise do nothing until this is true.

        You would also need some check like this, depending on the BarsAgo you look back you could change the 1 in the example to that number.

        This can also be the case with other collections you use, it would really depend on what specific syntax is being used. Keep in mind that TIck Replay does change the way the script calls OnBarUpdate so if you are using specific indexes, you may need to check if that index exists in the collection being used before trying to use it.

        I look forward to being of further assistance.
        Last edited by NinjaTrader_Jesse; 03-15-2017, 07:16 AM.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bouncetherubble, Yesterday, 06:56 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Started by frantic, Today, 06:37 AM
        0 responses
        4 views
        0 likes
        Last Post frantic
        by frantic
         
        Started by sergey_z, Today, 05:44 AM
        0 responses
        8 views
        0 likes
        Last Post sergey_z  
        Started by NinjaCustomer, Today, 12:29 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by ronaldgreene828, Yesterday, 07:50 PM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_EricB  
        Working...
        X