Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

type or namespace errors

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

    type or namespace errors

    Hello,
    I am having trouble with two errors. I'm a beginner coder so not sure how to fix it. One being 'TimeandSales' could not be found and name 'TimeandSales' does not exist in the current context.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.Indicators;
    using NinjaTrader.NinjaScript.DrawingTools;

    error on this line: TimeAndSales timeAndSales = TimeAndSales.GetData(CurrentBars[0]).LastOrDefault();
    if (timeAndSales == null)​

    any help will be greatly appreciated!
    Thank you!​

    #2
    Hello sirfrancisbacon1,

    The code you have shown is not valid, Are you trying to get some kind of market data?

    Comment


      #3
      yes time and sales data

      Comment


        #4
        Hello sirfrancisbacon1,

        Please see the following link for an example of accessing that data:

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        81 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        149 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        79 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        52 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        59 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X