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 Max238, Today, 01:28 AM
      1 response
      22 views
      0 likes
      Last Post CactusMan  
      Started by giulyko00, Yesterday, 12:03 PM
      2 responses
      10 views
      0 likes
      Last Post giulyko00  
      Started by r68cervera, Today, 05:29 AM
      0 responses
      4 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      6 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      38 views
      0 likes
      Last Post JonesJoker  
      Working...
      X