Thank you for your help.
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
Unable to see exposed variables and plots of custom indicator
Collapse
X
-
I think I see the issue, It appears that the NinjaScript compiler is not creating the correct constructors??
What would keep that from happening?
I write the code in Visual Studio and compile it in the Ninja Editor.
Leave a comment:
-
Hello jeliner,
May I also confirm you have compiled the script using the NinjaScript Editor so that the overload methods are autogenerated?
May I have an export of the script to test on my end?
To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:- Click Tools -> Export -> NinjaScript Add-on...
- Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
- Click the 'Export' button
- Enter the script name in the value for 'File name:'
- Choose a save location -> click Save
- Click OK to clear the export location message
- (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
Once exported, please attach the file as an attachment to your reply.
Leave a comment:
-
Originally posted by NinjaTrader_ChelseaB View PostHello jeliner,
The issue is not with exposed properties, but an issue with the overload parameters.
What is the overload signature of this method?
(Place the cursor after the opening curly brace and press Ctrl + Shift + space bar)
Note, anything using the Browsable(false) parameter will not be included with the overload parameters.
Code:#region SettingsProperties [Browsable(true), XmlIgnore] [Display(ResourceType = typeof(Custom.Resource), Name = "vixPeriod", GroupName = "Settings Vix", Order = 0)] public int Period { get { return _vixPeriod; } set { _vixPeriod = Math.Max(1, value); } } [Browsable(true), XmlIgnore] [Display(ResourceType = typeof(Custom.Resource), Name = "BB Period", GroupName = "Settings Vix", Order = 1)] public int bbPeriod { get { return _bbPeriod; } set { _bbPeriod = Math.Max(1, value); } } [Browsable(true), XmlIgnore] [Display(ResourceType = typeof(Custom.Resource), Name = "BB Std", GroupName = "Settings Vix", Order = 2)] public double std { get { return _vixStd; } set { _vixStd = Math.Max(1.0, value); } } #endregion
Namespace, class, and inheritance also seem correct.
Do I need to create a custom constructor?
I commented out the Color Properties, just on case that was causing the issue, but i receive the same error. The color properties are the only ones with Browsable(false)
Code:[Display(ResourceType = typeof(Custom.Resource), Name = "Up Highlight Color", GroupName = "Settings Color", Order = 0), XmlIgnore] public Brush UpHighlightPlotColor { get { return _uphighlightPlotColor; } set { _uphighlightPlotColor = value; } } [Browsable(false), XmlIgnore] public string UpHighlightPlotColorSerialize { get { return Serialize.BrushToString(_uphighlightPlotColor); } set { this._uphighlightPlotColor = Serialize.StringToBrush(value); } } //************** [Display(ResourceType = typeof(Custom.Resource), Name = "Down Highlight Color", GroupName = "Settings Color", Order = 1), XmlIgnore] public Brush DownHighlightPlotColor { get { return this._dwnhighlightPlotColor; } set { this._dwnhighlightPlotColor = value; } } [Browsable(false), XmlIgnore] public string DownHighlightPlotColorSerialize { get { return Serialize.BrushToString(_dwnhighlightPlotColor); } set { _dwnhighlightPlotColor = Serialize.StringToBrush(value); } }
Last edited by jeliner; 02-22-2024, 02:39 PM.
Leave a comment:
-
Hello jeliner,
The issue is not with exposed properties, but an issue with the overload parameters.
What is the overload signature of this method?
(Place the cursor after the opening curly brace and press Ctrl + Shift + space bar)
Note, anything using the Browsable(false) parameter will not be included with the overload parameters.
Leave a comment:
-
Originally posted by NinjaTrader_ChelseaB View PostHello jeliner,
longVix is public and is exposed.
To confirm, does the code below in another script cause an error?
Print(elTTVix(15,9,2).longVix[0])
May I have a screenshot of the error message?
I added your statement and I received the following error when I attempted to compile:
Last edited by jeliner; 02-22-2024, 02:25 PM.
Leave a comment:
-
Hello jeliner,
longVix is public and is exposed.
To confirm, does the code below in another script cause an error?
Print(elTTVix(15,9,2).longVix[0])
May I have a screenshot of the error message?
Leave a comment:
-
Unable to see exposed variables and plots of custom indicator
I have my AddPlots Properties as follows:
Code:[Browsable(false), XmlIgnore] public Series<double> longVix { get { return Values[0]; } } [Browsable(false), XmlIgnore] public Series<double> upperBB { get { return Values[1]; } } [Browsable(false), XmlIgnore] public Series<double> shortVix { get { return Values[2]; } } [Browsable(false), XmlIgnore] public Series<double> lowerBB { get { return Values[3]; } }
Code:AddPlot(Brushes.Orange, "Long Vix"); Plots[0].PlotStyle = PlotStyle.Bar; Plots[0].Width = 12; AddPlot(Brushes.Gray, "Long BB"); Plots[1].PlotStyle = PlotStyle.Dot; Plots[1].Width = 2; AddPlot(Brushes.Bisque, "Short Vix"); Plots[2].PlotStyle = PlotStyle.Bar; Plots[2].Width = 12; AddPlot(Brushes.Gray, "Short BB"); Plots[3].PlotStyle = PlotStyle.Dot; Plots[3].Width = 2;[FONT="Arial"][/FONT]
I have two exposed values coded as follows:
Code:[Browsable(false), XmlIgnore] public Series<int> vixDirection { get { return _dirVix; } } [Browsable(false), XmlIgnore] public int vixCurrentValue { get { return _dirVix[0]; } }
Code:[Browsable(true), XmlIgnore] [Display(ResourceType = typeof(Custom.Resource), Name = "vixPeriod", GroupName = "Settings Vix", Order = 0)] public int Period { get { return _vixPeriod; } set { _vixPeriod = Math.Max(1, value); } } [Browsable(true), XmlIgnore] [Display(ResourceType = typeof(Custom.Resource), Name = "BB Period", GroupName = "Settings Vix", Order = 1)] public int bbPeriod { get { return _bbPeriod; } set { _bbPeriod = Math.Max(1, value); } } [Browsable(true), XmlIgnore] [Display(ResourceType = typeof(Custom.Resource), Name = "BB Std", GroupName = "Settings Vix", Order = 2)] public double std { get { return _vixStd; } set { _vixStd = Math.Max(1.0, value); } }
However, when I attempt to obtain its exposed values in either a strategy or other indicator, I don't see them. Neither am I able to pass variables to control the settings properties.
I am looking to do something like this:
Code:int vixDir; vixDir = jelTTVix(15,9,2).vixDirection;
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cutzpr, Yesterday, 08:54 AM
|
1 response
14 views
0 likes
|
Last Post Today, 01:12 PM | ||
Started by gcztraders, Yesterday, 03:58 AM
|
1 response
16 views
0 likes
|
Last Post Today, 12:56 PM | ||
Started by reynoldsn, 05-10-2024, 07:04 PM
|
1 response
15 views
0 likes
|
Last Post Today, 12:48 PM | ||
Started by franciscog21, 05-10-2024, 05:27 PM
|
1 response
31 views
0 likes
|
Last Post Today, 12:46 PM | ||
Started by llanqui, Today, 11:10 AM
|
0 responses
11 views
0 likes
|
Last Post
by llanqui
Today, 11:10 AM
|
Leave a comment: