• 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

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 qewcool, Yesterday, 10:51 PM
      0 responses
      2 views
      0 likes
      Last Post qewcool
      by qewcool
       
      Started by momchi, Yesterday, 10:09 PM
      0 responses
      2 views
      0 likes
      Last Post momchi
      by momchi
       
      Started by crokusek, Yesterday, 09:56 PM
      0 responses
      2 views
      0 likes
      Last Post crokusek  
      Started by crokusek, Yesterday, 09:43 PM
      0 responses
      2 views
      0 likes
      Last Post crokusek  
      Started by Gregory Arkadin, Yesterday, 03:31 PM
      0 responses
      14 views
      0 likes
      Last Post Gregory Arkadin  
      Working...
      X