Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Draw objects on price chart AND indicator?

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

    Draw objects on price chart AND indicator?

    Hi there,

    I have a custom made indicator, which draws 'dots' on it when it finds certain patterns. That works pretty awesome. Because i'm drawing dots on the indicator, near the start of my code i use the function DrawOnPricePanel = false;

    I'm wondering if it's possible to ALSO have this indicator draw things on the price panel. Ie, i want to do both. Basically, i want it to make dots on the indicator when it identifies the pattern i'm looking for, and then print the entry price on the price chart. Is that possible?

    I tried it with the DrawArrowLine (just as a test) to draw an arrow at the previous swing low, once my indicator sees a potential new short. I tried this, but it is drawing the arrows on the indicator, not the price chart.

    DrawOnPricePanel = true;
    DrawArrowLine("NewShort", false, LowestBar(Low, lowBarsAgo)+4, Low[lowBarsAgo], LowestBar(Low, lowBarsAgo), Low[lowBarsAgo],Color.Blue, DashStyle.Solid, 2);
    DrawOnPricePanel = false;


    So, the logic of my DrawArrowLine seems to work fine, but like i said, i want it to draw the arrows on the price chart (but keep the dots i draw earlier on the indicator panel).

    Anyone know how i might accomplish this?

    Thanks!!
    Mr. Orange

    #2
    Hello MrOrange,

    The only supported technique for drawing on both indicator panel and price panel is to use two separate indicators.

    We are currently tracking the suggestion to draw on both panels with ID # 845.

    Some users report success dynamically setting DrawOnPricePanel, so you may want to check these forums to see what others have been able to do.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ah, okay, thanks for the head's up.

      Comment


        #4
        If you want to be able to switch in that manner, you must explicitly set DrawOnPricePanel = true; in the Initialize() method. After that you can switch dynamically.

        I am sure that was not intended by NT, as they insist that there is no way to dynamically switch the drawing panel. I guess its a bug in their mind, and a feature in ours. One can but hope that they will not deliberately disable this one in the future.

        Comment


          #5
          Hey, thanks a lot for that koganam!! I think that's the second time you've solved a problem for me. Very much appreciated!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,227 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          7 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          440 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          12 views
          0 likes
          Last Post FAQtrader  
          Working...
          X