Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Guidance about built a ChartStyle + OnMarketData

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

    Guidance about built a ChartStyle + OnMarketData

    HiLow Ninjas

    I need to develop a new ChartStyle, I woul like to know how can i access the onMarketData method inside of the ChartStyle code??
    I asked this because a need to reproduce inside the ChartStyle's code a MiniBook.
    If is not possible, how can I accses the bid and ask value and volume like a code below:

    protected override void OnMarketData(MarketDataEventArgs e)
    {

    if (e.MarketDataType == MarketDataType.Ask)
    {
    // do something
    }
    if (e.MarketDataType == MarketDataType.Bid)
    {
    // do something
    }
    if (e.MarketDataType == MarketDataType.Last)
    {
    // do something
    }
    }
    Thanks

    #2
    Hello MarceloF,

    Welcome to the forums!

    You will not be able to use OnMarketData() in a ChartStyle. However, I would advise to use GetBid() and GetAsk() to get the bid/ask from a ChartStyle. Volume can be retrieved with GetVolume().

    I have provided links to our openly available documentation on these items.

    GetBid() - https://ninjatrader.com/support/help...-us/getbid.htm

    GetAsk() - https://ninjatrader.com/support/help...-us/getask.htm

    GetVolume() - https://ninjatrader.com/support/help.../getvolume.htm

    If there is anything else I can do to be of further assistance, please let me know.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RideMe, 04-07-2024, 04:54 PM
    5 responses
    28 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by f.saeidi, Today, 08:13 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by DavidHP, Today, 07:56 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by kujista, Today, 06:23 AM
    3 responses
    9 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by Mindset, Yesterday, 02:04 AM
    2 responses
    18 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Working...
    X