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

Ticks by bid and ask color

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

    Ticks by bid and ask color

    Hi to everyone!
    I want colorize current real time ticks by ask or bid (red and green colors).

    I do it like that:

    protected override void OnMarketData(MarketDataEventArgs e)
    {
    if (e.MarketDataType == MarketDataType.Last)
    {

    //buy tick
    if(e.Price >=e.MarketData.Ask.Price)
    color = Color.Green;
    //sell tick
    else if(e.Price <= e.MarketData.Bid.Price)
    color = Color.Red;

    }

    }

    ...but this is dont work correctly such as "time&sales" windows in NT. Colors are different. Whats wrong?

    Thanks!
    Last edited by s21462; 06-28-2011, 05:55 AM.

    #2
    Welcome to our forums - unfortunately we could not disclose the Time and Sales code used, what colors are you then comparing to? It would make several distinctions between at ask, above ask, below bid and at bid.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Welcome to our forums - unfortunately we could not disclose the Time and Sales code used, what colors are you then comparing to? It would make several distinctions between at ask, above ask, below bid and at bid.
      Thanks!

      Colors in time&sales


      For example - ticks color in Time&Sales windows is green (at ask, or above ask), but in indicator (see code) color of the same tick different (sometimes colors is same).
      Can you tell me, correctly I determine color of current tick in the code or not, please.

      Comment


        #4
        I believe the code should do what you seek - to compare please ensure the update intervals of the chart vs the time sales window are set the same so you're seeing the correct timing.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by mgco4you, Today, 09:46 PM
        0 responses
        1 view
        0 likes
        Last Post mgco4you  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 07:51 PM
        0 responses
        8 views
        0 likes
        Last Post Rapine Heihei  
        Working...
        X