Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compilation error help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Compilation error help

    I just installed the latest version and custom indicators aren't working. I have very minimal programming experience and none with ninja script so I hope someone can help. I tried to compile one of the indicators that is no longer working and came up with a bunch of errors, all similar in description. CS0101 and CS0102 are the codes I get. The first error code says " the namespace "NinjaTrader.indicator" already contains a definition for "a1MarketInternals" ". The next error has to do with the "TickStyle" part of the script and gives the CS0102 code and says "The type "NinjaTrader.indicator.a1MarketInternals" already contains a definition for "TickStyle". This is how the problem area for the errors appears and I applied BOLD to the lines of script that I believe are wrong.

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Gui.Chart;
    using System.IO;
    using System.Globalization;
    using System.Collections.Generic;

    using System.Text.RegularExpressions;
    using System.Windows.Forms;

    #endregion

    namespace NinjaTrader.Indicator
    {
    [Description("NYSE TICK and Advance/Decline Line Market Internals")]
    public class a1MarketInternals : Indicator
    {
    #region Variables

    string tkSymbol = "^TICK";
    string adSymbol = "^ADD";
    int tkMinutes = 1;
    int nyseTickHigh = 800;
    int nyseTickLow = -800;

    bool showADplot = true;
    bool showTickPlot = true;
    Color adColor = Color.Yellow;

    TimeSpan newYorkOpen = new TimeSpan(09, 30, 00);
    TimeSpan newYorkClose= new TimeSpan(16, 00, 00);
    TimeZoneInfo est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");


    public enum TickStyle {
    CandleStick,
    HollowCandles,
    HiLoClose,
    };
    private TickStyle tickStyle = TickStyle.CandleStick;

    int scaleMaxPixels = 0;
    int verticalOffset = 0;
    double tickOpen=0, tickHigh=0, tickLow=0, tickClose=0;
    double adClose=0;
    int tickBar=0, lastTickBar=0, lastTkPriceBar=0;
    int tickHighBreachBar=0, tickLowBreachBar=0;
    int adXpix0=0, adYpix0=0, adXpix1=0, adYpix1=0;
    string tkStat= "???";

    double d=0;
    int x=0, y=0;

    Font textFont = new Font("Impact", 10, System.Drawing.FontStyle.Regular);
    StringFormat FormatLeft = new StringFormat();

    private bool ShowOutline = true;
    private bool EnhanceHL = true;


    private bool ReinitSession = false;
    private bool ForceHiLo = true;

    private int ForcedHiLoBS = 2;

    private int totalvolume = 0, hi, lo;

    private DataSeries dsHigh, dsLow, dsClose;
    private DataSeries adPlot;

    private int startbar = -1;
    private int lastBar = -1;

    private bool useplot = true;
    Pen drawPen = new Pen(Color.Transparent);
    Pen adPen = new Pen(Color.Transparent, 4);
    Pen linePen = new Pen(Color.Black, 5);
    SolidBrush drawBrush = new SolidBrush(Color.Transparent);

    int hiTkBar=0, loTkBar=0;

    #endregion


    protected override void Initialize() {
    Overlay = false;
    PriceTypeSupported = false;
    CalculateOnBarClose = false;
    DrawOnPricePanel = true;

    Add("^TICK",PeriodType.Minute, 1);
    Add("^ADD", PeriodType.Minute, 1);
    }

    protected override void OnStartUp() {
    dsHigh = new DataSeries(this, MaximumBarsLookBack.Infinite);
    dsLow = new DataSeries(this, MaximumBarsLookBack.Infinite);
    dsClose = new DataSeries(this, MaximumBarsLookBack.Infinite);

    adPen.Color = adColor;
    adPlot = new DataSeries(this, MaximumBarsLookBack.Infinite);
    }

    Thanks in advance for any help--

    #2
    Biaxident,

    Thank you for your post.

    Typically, this error means that there is another file or duplicate file that has the same class namespace and/or enum that is being defined.

    Can you check your PC -> (My) Documents -> NinjaTrader 7 -> bin -> Custom
    Look around the Strategy and Indicator folders for any other scripts that could be interferring with it.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by shanshan1001, Today, 08:12 PM
    0 responses
    3 views
    0 likes
    Last Post shanshan1001  
    Started by cidafialho90, Today, 06:53 PM
    0 responses
    5 views
    0 likes
    Last Post cidafialho90  
    Started by idan2208, Today, 04:06 PM
    0 responses
    7 views
    0 likes
    Last Post idan2208  
    Started by Zinger357, 11-03-2024, 08:56 PM
    8 responses
    81 views
    0 likes
    Last Post Zinger357  
    Started by patrickbenitez, Today, 01:20 PM
    0 responses
    7 views
    0 likes
    Last Post patrickbenitez  
    Working...
    X