İş Gereklilikleri
Hello. I have a custom NinjaScript indicator that is not compiling correctly. Can anyone take a look at it and see if you can resolve the errors? This code plots offset lines above and below the 14 ema,
using System; using System.Windows.Media; namespace GeneralTradingApp { public class ProfitTargetTickOffset { public int TickCount { get; set; } public Brush UpperLineColor { get; set; } public Brush LowerLineColor { get; set; } public ProfitTargetTickOffset(int tickCount, Brush upperColor, Brush lowerColor) { TickCount = tickCount; UpperLineColor = upperColor ?? Brushes.SlateGray; LowerLineColor = lowerColor ?? Brushes.SlateGray; } public void CalculateLines(double emaValue, double tickSize) { double upperLine = emaValue + TickCount * tickSize; double lowerLine = emaValue - TickCount * tickSize; Console.WriteLine($"Upper Line: {upperLine}, Color: {UpperLineColor}"); Console.WriteLine($"Lower Line: {lowerLine}, Color: {LowerLineColor}"); } } class Program { static void Main() { // Example usage ProfitTargetTickOffset offset = new ProfitTargetTickOffset(24, Brushes.Blue, Brushes.Red); double exampleEMAValue = 1200.5; // Replace with actual logic for EMA calculation double tickSize = 0.01; // Replace with actual tick size offset.CalculateLines(exampleEMAValue, tickSize); } } }