Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to have one indicator be a slave of another indicator.

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

    How to have one indicator be a slave of another indicator.

    Hello awesome tech support staff!

    I have a complex indicator that draws many plots on its own chart pane (IsOverlay == false) but I now need to also plot some data on the main chart.

    My first idea was to create a new indicator with 'IsOverlay == true' but I'm facing some threading issues between the two indicators...

    It is apparent during debugging that the Time[0] value in both indicators doesn't match. This indicates to me that the thread responsible for my new 'overlay' indicator is not as far along as chart pane indicator but unfortunately even a call to 'Update()' does not make them sync up.

    Is there a way to do this?

    Thanks!

    #2
    Hello JPPoulin,

    Thanks for your post.

    By design, indicators will only be able to draw to one panel. Two indicators must be used to draw to separate panels, but I could not provide much advice for how one indicator can modify another indicator's plot values. I have had some success modifying indicators which are added by a strategy, and I have attached an example.

    The example I have attached shows the Time[0] prints for each script coming out in groups as the historical data is processed. (Historical data in OnBarUpdate is processed in a thread pool.) When realtime data is processed on the instrument thread, these prints are in a more expected order.

    Our recommendation for drawing in separate panels would be to implement your plotting/drawing code into separate indicators where they can draw into their designated space independently.

    If you have any other specific questions, providing test scripts that show what you are attempting can help.

    We look forward to being of any further assistance.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim

      Thanks very much for the prompt response and the useful example.

      It's good to know it's not possible for one indicator to push or pull value from another. I'll try through the strategy approach

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by swestendorf, Today, 11:14 AM
      1 response
      1 view
      0 likes
      Last Post swestendorf  
      Started by Sparkyboy, Today, 10:57 AM
      0 responses
      4 views
      0 likes
      Last Post Sparkyboy  
      Started by TheMarlin801, 10-13-2020, 01:40 AM
      21 responses
      3,917 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by timmbbo, 07-05-2023, 10:21 PM
      3 responses
      155 views
      0 likes
      Last Post grayfrog  
      Started by Lumbeezl, 01-11-2022, 06:50 PM
      30 responses
      812 views
      1 like
      Last Post grayfrog  
      Working...
      X