Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsRequest & Indicators

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

    BarsRequest & Indicators

    Hello,

    I need load several BarsSeries into my indicator dynamically through on user request by a properties dialog. The user may open the properties dialog at any time and request new BarSeries.

    Is this possible with indicators by using the BarsRequest class or it is incompatible ? (Help about BarsRequest says: The concept can be carried over to any NinjaScript object you may be working on.)

    If I use BarsRequest within an indicator seems to work well (the method to handle the Update event from my BarsSerie loaded with BarsRequest works well and it is executed with each tick) until the OnBarUpdate method of the indicator is executed. From this moment the Update handler method is not executed anymore. There aren't exceptions and the indicator continues working well.

    Thanks

    #2
    Hi cls71,

    Are you attempting to use OnBarUpdate as the event handler for your custom series?
    If so, you will need your own method to use as an event handler.

    Attached is an example of how this would work.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      No, my custom barsSerie has his own handler method. All is working well until that OnBarUpdate method of the indicator is executed. Then, the custom barSerie handler method is not executed anymore.

      (I know this issue can be resolved with Addons but the Help says that BarsRequest may be used within any NinjaScript so I would want try it with one only indicator, without addons ... but seems that does not work)

      Comment


        #4
        Hi cls71,

        Have you tested the script I have provided? The script does need a symbol input for the secondary series.

        This is working on my end without any issues. Are you experiencing the same behavior with the example script?

        This script demonstrates how to do a BarsRequest in an indicator. Is this not what you are wanting an example of?
        Last edited by NinjaTrader_ChelseaB; 04-08-2016, 01:54 PM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks so much, Chelsea.

          your code works perfectly. I must be wrong somewhere in my code.

          Regards

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by r68cervera, Today, 05:29 AM
          0 responses
          3 views
          0 likes
          Last Post r68cervera  
          Started by geddyisodin, Today, 05:20 AM
          0 responses
          3 views
          0 likes
          Last Post geddyisodin  
          Started by JonesJoker, 04-22-2024, 12:23 PM
          6 responses
          35 views
          0 likes
          Last Post JonesJoker  
          Started by GussJ, 03-04-2020, 03:11 PM
          12 responses
          3,239 views
          0 likes
          Last Post Leafcutter  
          Started by AveryFlynn, Today, 04:57 AM
          0 responses
          6 views
          0 likes
          Last Post AveryFlynn  
          Working...
          X