Thanks
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!
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
NinjaTrader
Non readable drawings on Panel Custom Indicator
Collapse
X
-
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?
Thanks2 PhotosTags: None
-
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
-
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 IanS00, 03-27-2024, 11:24 AM
|
2 responses
11 views
0 likes
|
Last Post Today, 02:00 AM | ||
Started by Mariawilcoxi, Today, 01:32 AM
|
0 responses
1 view
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
4 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
46 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
6 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
Comment