Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

error Marketdataeventargs could not be found

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

    error Marketdataeventargs could not be found

    I am trying to add this to my code in Ninja8 and when I hit compile I get

    Marketdataeventargs could not be found (are you missing using a directive or an assembly????????????????????????????







    protected override void OnMarketData(MarketDataEventArgs e)
    {
    if (e.MarketDataType == MarketDataType.Ask)
    {
    //askPrice = e.Price;
    }
    }



    here are my declarations

    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Windows.Media;
    using System.Xml.Serialization;
    #endregion












    #2
    Hello marluv,

    It looks like you are missing the standard using statements that you need for most NinjaScript related classes. Please do the following:
    Open any indicator, for example the ADL
    Copy the using statements from the top
    If you have at this point manually added any using statements, take those statements out and place them a few lines below the top.
    Paste the using statements from the ADL at the top of the file.

    The using statements that you see in other files and also when you generate new NinjaScript files are required to avoid this type of error.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X