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 SantoshXX, Today, 03:09 AM
          0 responses
          11 views
          0 likes
          Last Post SantoshXX  
          Started by DanielTynera, Today, 01:14 AM
          0 responses
          2 views
          0 likes
          Last Post DanielTynera  
          Started by yertle, 04-18-2024, 08:38 AM
          9 responses
          41 views
          0 likes
          Last Post yertle
          by yertle
           
          Started by techgetgame, Yesterday, 11:42 PM
          0 responses
          12 views
          0 likes
          Last Post techgetgame  
          Started by sephichapdson, Yesterday, 11:36 PM
          0 responses
          2 views
          0 likes
          Last Post sephichapdson  
          Working...
          X