I have done plenty of private classes within indicators but I wanted to try my hand at an external/public class to be accessed by many indicators.
I followed the instructions to make a partial class in 'Code Breaking Changes' however I can't seem to access my class from another indicator.
The whole 'Addon' thing still confuses me so I tried adding a duplicate of sorts in both Addons and Indicators.
I would appreciate it if you can take a look at the code below and advise me what to do.
namespace NinjaTrader.NinjaScript.Indicators.Sim22 { /// <summary> /// A function to help generate LinearGradient brushes by Sim22 Nov 2015 /// </summary> public partial class Sim22_LinearGradientBrushFunction : Indicator { public static LinearGradientBrush linBrushFunction(Point startPoint, Point endPoint, Brush gs1Brush, double gs1Offset, Brush gs2Brush, double gs2Offset, Brush gs3Brush, double gs3Offset, Brush gs4Brush, double gs4Offset, Brush gs5Brush, double gs5Offset, Brush gs6Brush, double gs6Offset) { System.Windows.Media.LinearGradientBrush linBrush = new LinearGradientBrush(); linBrush.StartPoint = startPoint; linBrush.EndPoint = endPoint; GradientStop gs1 = new GradientStop(); gs1.Offset = gs1Offset; SolidColorBrush gs1SCB = (SolidColorBrush)gs1Brush; gs1SCB.Freeze(); gs1.Color = gs1SCB.Color; linBrush.GradientStops.Add(gs1); GradientStop gs2 = new GradientStop(); gs2.Offset = gs2Offset; SolidColorBrush gs2SCB = (SolidColorBrush)gs2Brush; gs2SCB.Freeze(); gs2.Color = gs2SCB.Color; linBrush.GradientStops.Add(gs2); GradientStop gs3 = new GradientStop(); gs3.Offset = gs3Offset; SolidColorBrush gs3SCB = (SolidColorBrush)gs3Brush; gs3SCB.Freeze(); gs3.Color = gs3SCB.Color; linBrush.GradientStops.Add(gs3); GradientStop gs4 = new GradientStop(); gs4.Offset = gs4Offset; SolidColorBrush gs4SCB = (SolidColorBrush)gs4Brush; gs4SCB.Freeze(); gs4.Color = gs4SCB.Color; linBrush.GradientStops.Add(gs4); GradientStop gs5 = new GradientStop(); gs5.Offset = gs5Offset; SolidColorBrush gs5SCB = (SolidColorBrush)gs5Brush; gs5SCB.Freeze(); gs5.Color = gs5SCB.Color; linBrush.GradientStops.Add(gs5); GradientStop gs6 = new GradientStop(); gs6.Offset = gs6Offset; SolidColorBrush gs6SCB = (SolidColorBrush)gs6Brush; gs6SCB.Freeze(); gs6.Color = gs6SCB.Color; linBrush.GradientStops.Add(gs6); linBrush.Freeze(); return linBrush; } } }
Simon.
Comment