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

Day of the Week highlight bars

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

    Day of the Week highlight bars

    Good Afternoon,
    How does one create different colored highlight bars signifying what day it is?
    For example, if I have an NT chart up with one weeks worth of 30 minute bars of SPY, how can someone make all the 30 minute bars on Monday green, all the
    30 minute bars from Tuesday white, all the 30 minute bars for Wednesdays red. etc. etc.I would appreciate anyones help, who understands and knows how to use 'script language'.

    Joshua

    #2
    Hi joshuas7,

    You could certainly do something with BarColor and Time[0]...

    Code:
    if (Time[0].DayOfWeek==DayOfWeek.Monday)
    			BarColor = Color.Blue;
    TimNinjaTrader Customer Service

    Comment


      #3
      if (Time[0].DayOfWeek==DayOfWeek.Monday)
      BarColor = Color.Blue;

      if (Time[0].DayOfWeek==DayOfWeek.Tuesday)
      BarColor = Color.White;

      if (Time[0].DayOfWeek==DayOfWeek.Wednesday)
      BarColor = Color.Red;

      if (Time[0].DayOfWeek==DayOfWeek.Thursday)
      BarColor = Color.Green;

      if (Time[0].DayOfWeek==DayOfWeek.Friday)
      BarColor = Color.Orange;

      Hi Tim,
      I really appreciate the help. Based on the 'code' you sent me, would the next four I typed out be correct? I'm sure there are online instructions somewhere on NT regarding the how to's for plugging them in. Could you or someone else reading this, direct me towards the NT address where I can get started now that I have the right info to plugin?

      Thanks again

      Comment


        #4
        Hi joshuas7,


        My advice to get started is to use the Wizard at: "Tools>New NS>Indicator" give it a name then select "Generate", put your code under "OnBarUpdate".

        These steps are similar to those found in our tutorials: http://www.ninjatrader-support.com/H...tml?Overview23
        TimNinjaTrader Customer Service

        Comment


          #5
          Looking for the same

          Hi, joshuas7, i am loking for the same indicator.... that colors bars depending on days of the week. Did you find one? can you share? i am total noob in pogramming.

          thx in advance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by AaronKoRn, Today, 09:49 PM
          0 responses
          11 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Today, 08:42 PM
          0 responses
          10 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Today, 07:51 PM
          0 responses
          11 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,980 views
          3 likes
          Last Post jhudas88  
          Started by rbeckmann05, Today, 06:48 PM
          0 responses
          9 views
          0 likes
          Last Post rbeckmann05  
          Working...
          X