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

Non readable drawings on Panel Custom Indicator

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

    Non readable drawings on Panel Custom Indicator

    Hello, I'm building a NinjaScript Strategy based on Custom Indicators, the problem is that there is an indicator that is drawn on a panel but it does not have plot parameters in its configuration, so I cannot read the drawings it makes; I need to know when it make a drawing as part of a sign, I've attached a image with de panel drawings, those drawings are not selectable by the GUI, is there any chance to read them?
    Thanks

    #2
    Hello Quanto,

    Thank you for your note.

    If the indicator does not create some kind of exposed value that changes to indicate when the drawings are created, it would need to be modified to do so. If the indicator is open source you may be able to take a look at the code and create an exposed series that for example might have a value of 0 when no drawing is present, 1 when red and 2 when green, however, you can only do this if the code for the indicator is editable in the NinjaScript Editor. An example of exposing a series that is not a plot may be found in our help guide here:



    If the indicator was obtained from a third party vendor, these are often distributed as compiled assemblies, and the code cannot be edited. In this case, you would need to reach out to the vendor to see if those could be added to the indicator, however, in most cases this would not be possible.

    The final option would be to reproduce the logic the indicator uses to determine whether or not to draw those objects within your strategy itself, but you'd have to be able to reproduce those calculations which may not be possible if you don't know exactly how the indicator calculates those.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks Kate W.

      I already did it, I used the BackBrush property to read the color changes on the indicator, here is the solution for anyone who need it:

      protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
      {
      ChartObjectCollection<NinjaTrader.Gui.NinjaScript. IndicatorRenderBase> indicatorCollection = chartControl.Indicators;

      foreach (NinjaTrader.Gui.NinjaScript.IndicatorRenderBase indicator in indicatorCollection)
      {
      try
      {
      if(indicator.Name=="CustomIndicatorName")
      {
      Print("BackBrush: "+indicator.BackBrush);//This value could be used as signal
      }
      }
      catch(Exception ex)
      {
      Print("EX:"+ex.Message);
      }
      }
      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by yertle, Today, 08:38 AM
      0 responses
      1 view
      0 likes
      Last Post yertle
      by yertle
       
      Started by Mestor, 03-10-2023, 01:50 AM
      15 responses
      378 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by samish18, Yesterday, 08:57 AM
      10 responses
      27 views
      0 likes
      Last Post samish18  
      Started by matty89, 03-02-2020, 08:31 AM
      34 responses
      3,039 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Started by kujista, Today, 05:44 AM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X