Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

several indicators in strategy

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

    several indicators in strategy

    Hi All,

    I want to use several separate indicators to monitor attributes of the incoming price bar then detect conditional events as they occur and communicate them to my strategy so that it can combine them in the correct sequence then trigger market orders.

    I'd like to use simple inter-object event handling code my custom indicators can fire an event and get on looking for the next one. I see you have TriggerCustomEvent. Can this be used to fire events to a central strategy that will be responsible for determining if a subsequent action should be taken?

    Can you include some multi-indicator interactive code samples please?

    Regards,

    Paul

    #2
    Hi Paul, I'm not sure I follow why you would need to work with custom events for this, you can directly call your indicators from the strategy to access plotted signals or any exposed calcs / variables -

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Paul, I'm not sure I follow why you would need to work with custom events for this, you can directly call your indicators from the strategy to access plotted signals or any exposed calcs / variables -

      http://www.ninjatrader-support2.com/...ead.php?t=4991
      Yes, I see I can instantiate Indicators as attributes of Strategies then check attributes directly.

      I'd like to have each Indicator monitor the OnBarUpdate event for Bars that exhibit specific characteristics and or sequences and provide a visualisation on charts when they occur. As a target combination is found, I'd like it to message the controlling strategy using a specialised event so that it can increment the state of the overall strategy. When a specific combination of disparate Indicator events has occurred in a specific sequence, I'd like to trigger or cancel an order or close out a position.

      Without decoupled events, I will need to poll each Indicator or the plotted signals to find out if the particular characteristic has been seen each time a bar event arrives. Trapping events is a far cleaner way to do things than monitoring a set of flags.

      Is there a down side to using events?

      Comment


        #4
        Hi Paul, thanks for clarifying, I understand where you're coming from - however if you store you're signal generation in a dataseries you could also access it the proper sequence - if you want to work with custom events you would need then to expose the internal variables you set in the indicators to access them from a strategy (which needed to run on updating each tick, CalculateOnBarClose = false, able to process intrabar in realtime then) -

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Hi Paul, thanks for clarifying, I understand where you're coming from
          So issue is either polling your Boolean data series or waiting for an event to arrive.

          - however if you store you're signal generation in a dataseries you could also access it the proper sequence
          So in my strategy, I will need to make sure the indicator has serviced the current bar (which apparently happens automatically if I check an indicator attribute) then check the current data series inside the indicator to see if it has triggered the event (that I'm looking for) that has been stored as a boolean flag in a boolean data series (or create a public method) every time the OnBarUpdate event arrives at the strategy.

          Is this correct as it seems a bit like using a sledge hammer to crack a walnut?

          - if you want to work with custom events you would need then to expose the internal variables you set in the indicators to access them from a strategy
          I did not plan to do this as the event would be specific and encode what we're looking for. Any strategy can take note of the event or ignore it. I would not need to ask the Indicator if the event had happened as it would be implicit by receiving it.

          (which needed to run on updating each tick, CalculateOnBarClose = false, able to process intrabar in realtime then)
          So does the problem relate to synchronisation? Is it that if we use standard C# event delegation from the indicator object to the strategy object, we may have already received the OnBarUpdate event in the strategy. Is that how you see this?

          Comment


            #6
            Paul, unfortunately we can't support C# here, but your boolseries related understanding is correct, I believe this would provide the best approach to check if the referenced indicators generated your signals to have the strategy act on.

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Paul, unfortunately we can't support C# here, but your boolseries related understanding is correct, I believe this would provide the best approach to check if the referenced indicators generated your signals to have the strategy act on.
              Bernard,
              I appreciate your replies.

              I have quite a lot of experience implementing all sorts of systems from robotics controls to sub cable surveillance systems. Fully decoupled event based systems are always the best performance and simplest. Would you be prepared to support me if I make this work with events instead of polling data objects?

              Paul

              Comment


                #8
                You're welcome Paul - for custom event handling we can support what we laid out in this sample here - http://www.ninjatrader-support2.com/...ead.php?t=5965

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  You're welcome Paul - for custom event handling we can support what we laid out in this sample here - http://www.ninjatrader-support2.com/...ead.php?t=5965
                  Have you revised the way events are handled in N7?

                  Comment


                    #10
                    I'll check into - I don't believe there were general changes, just an overload change.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    631 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    566 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X