• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 psquare, Today, 03:11 PM
    4 responses
    12 views
    0 likes
    Last Post psquare
    by psquare
     
    Started by ballboy11, Today, 03:20 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by tonynt, Today, 02:18 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Started by denalek2419, Today, 01:46 PM
    3 responses
    12 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by REI140205, Today, 12:58 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jim  
    Working...
    X