NexusFi: Find Your Edge


Home Menu

 





Colour time zones indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one bill897 with 3 posts (0 thanks)
    2. looks_two Sam7768 with 3 posts (0 thanks)
    3. looks_3 sam028 with 2 posts (2 thanks)
    4. looks_4 Jeff Castille with 2 posts (4 thanks)
      Best Posters
    1. looks_one Jeff Castille with 2 thanks per post
    2. looks_two sam028 with 1 thanks per post
    3. looks_3 wh with 1 thanks per post
    4. looks_4 Slipknot511 with 1 thanks per post
    1. trending_up 15,349 views
    2. thumb_up 9 thanks given
    3. group 9 followers
    1. forum 17 posts
    2. attach_file 6 attachments




 
Search this Thread
  #1 (permalink)
nickohorny
birmingham
 
Posts: 1 since Jan 2010
Thanks Given: 0
Thanks Received: 0

Hi Guys

I am very new and been searching for an indicator for Ninja that will let me colour/highlight certain areas of my chart - eg/ colour between 12-2pm as red etc. I thought that Ninja would let me do this within properties but seems not.

I have been through the indicator section but cannot seem to find anything? Any help greatly appreciated.

Thanks
Nick


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Hormuz Completely Closed: US Strikes Day 2, Iran Shoots …
Traders Hideout
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
May 26 Deadline Dies at 7.5% as US Strikes Iran During C …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
wh's Avatar
 wh 
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
Posts: 538 since Jun 2009
Thanks Given: 298
Thanks Received: 512


test this one

 
Code
                            
 if( (ToTime(Time[0]) >= 000000 && ToTime(Time[0]) <= 010000)||
                (
ToTime(Time[0]) >= 020000 && ToTime(Time[0]) <= 030000)||
                (
ToTime(Time[0]) >= 040000 && ToTime(Time[0]) <= 050000)||
                (
ToTime(Time[0]) >= 060000 && ToTime(Time[0]) <= 070000)||
                (
ToTime(Time[0]) >= 080000 && ToTime(Time[0]) <= 090000)||
                (
ToTime(Time[0]) >= 100000 && ToTime(Time[0]) <= 110000)||
                (
ToTime(Time[0]) >= 120000 && ToTime(Time[0]) <= 130000)||
                (
ToTime(Time[0]) >= 140000 && ToTime(Time[0]) <= 150000) || 
                (
ToTime(Time[0]) >= 160000 && ToTime(Time[0]) <= 170000)||
                (
ToTime(Time[0]) >= 180000 && ToTime(Time[0]) <= 190000)||
                (
ToTime(Time[0]) >= 200000 && ToTime(Time[0]) <= 210000)||
                (
ToTime(Time[0]) >= 220000 && ToTime(Time[0]) <= 230000
                )
                  
                {
                    
BackColor Color.DarkGray;
                    
                       
tradecolor Color.Gray;
                    
                    
                }
                else
                {
                
                       
tradecolor Color.Gray;
                } 


Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Attached Files
Elite Membership required to download: TradingTime.cs
Reply With Quote
Thanked by:
  #4 (permalink)
 
eDanny's Avatar
 eDanny 
East Rochester, NY
 
Experience: Intermediate
Platform: NT
Posts: 329 since Jul 2009
Thanks Given: 18
Thanks Received: 425

Remember that anytime you try something like that on non time based charts it will be inaccurate. Example: If you have a 2000 tick chart and the color is supposed to change at 12:00 noon till 1:00PM (lunch maybe) and the 11:58 AM candle does not close till 12:04 PM, you will not get a color change till 12:04 PM. Just a heads up. You might only want to use an indicator like this on a time chart with intervals set to be able to land right on your desired color change times.

Dan


Reply With Quote
Thanked by:
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,759 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,647


wh View Post
test this one

 
Code
                            
 if ( (ToTime(Time[0]) >= 000000 && ToTime(Time[0]) <= 010000)||
                (
ToTime(Time[0]) >= 020000 && ToTime(Time[0]) <= 030000)||
                (
ToTime(Time[0]) >= 040000 && ToTime(Time[0]) <= 050000)||
                (
ToTime(Time[0]) >= 060000 && ToTime(Time[0]) <= 070000)||
                (
ToTime(Time[0]) >= 080000 && ToTime(Time[0]) <= 090000)||
                (
ToTime(Time[0]) >= 100000 && ToTime(Time[0]) <= 110000)||
                (
ToTime(Time[0]) >= 120000 && ToTime(Time[0]) <= 130000)||
                (
ToTime(Time[0]) >= 140000 && ToTime(Time[0]) <= 150000) || 
                (
ToTime(Time[0]) >= 160000 && ToTime(Time[0]) <= 170000)||
                (
ToTime(Time[0]) >= 180000 && ToTime(Time[0]) <= 190000)||
                (
ToTime(Time[0]) >= 200000 && ToTime(Time[0]) <= 210000)||
                (
ToTime(Time[0]) >= 220000 && ToTime(Time[0]) <= 230000
                )
                  
                {
                    
BackColor Color.DarkGray;
                    
                       
tradecolor Color.Gray;
                    
                    
                }
                else
                {
                
                       
tradecolor Color.Gray;
                } 


Why not something like:

 
Code
                            
if (((Time[0].Hour) % 2) == 0)                  
{
  
BackColor Color.DarkGray;            
  
tradecolor Color.Gray;
}
else
  {
... 


Success requires no deodorant! (Sun Tzu)
Reply With Quote
Thanked by:
  #6 (permalink)
 
Jeff Castille's Avatar
 Jeff Castille 
Northern California
Legendary Market Wizard
 
Experience: Intermediate
Platform: Charles Schwab
Broker: Charles Schwab
Trading: Gold/Silver Fertilizers
Frequency: Other
Duration: Months
Posts: 2,111 since Jun 2009
Thanks Given: 1,785
Thanks Received: 3,311


wh View Post
test this one

 
Code
                            
 if( (ToTime(Time[0]) >= 000000 && ToTime(Time[0]) <= 010000)||
                (
ToTime(Time[0]) >= 020000 && ToTime(Time[0]) <= 030000)||
                (
ToTime(Time[0]) >= 040000 && ToTime(Time[0]) <= 050000)||
                (
ToTime(Time[0]) >= 060000 && ToTime(Time[0]) <= 070000)||
                (
ToTime(Time[0]) >= 080000 && ToTime(Time[0]) <= 090000)||
                (
ToTime(Time[0]) >= 100000 && ToTime(Time[0]) <= 110000)||
                (
ToTime(Time[0]) >= 120000 && ToTime(Time[0]) <= 130000)||
                (
ToTime(Time[0]) >= 140000 && ToTime(Time[0]) <= 150000) || 
                (
ToTime(Time[0]) >= 160000 && ToTime(Time[0]) <= 170000)||
                (
ToTime(Time[0]) >= 180000 && ToTime(Time[0]) <= 190000)||
                (
ToTime(Time[0]) >= 200000 && ToTime(Time[0]) <= 210000)||
                (
ToTime(Time[0]) >= 220000 && ToTime(Time[0]) <= 230000
                )
 
                {
                    
BackColor Color.DarkGray;
 
                       
tradecolor Color.Gray;
 
 
                }
                else
                {
 
                       
tradecolor Color.Gray;
                } 

Hey WH,

Is there a way that you could code this indicator to be able to choose the color for both no trade times (red) and trade times(green or blue) ? I was thinking of using this in a separate panel.


Attached Thumbnails
Click image for larger version

Name:	YM 03-10  2_16_2010 (5 Min).jpg
Views:	629
Size:	134.7 KB
ID:	8193  
Follow me on X Reply With Quote
Thanked by:
  #7 (permalink)
 SawDr 
Washington, DC
 
Experience: Intermediate
Platform: Ninja and TOS
Broker: Ninja
Trading: CL, ES
Posts: 100 since Dec 2009
Thanks Given: 114
Thanks Received: 62

Does anyone have this indicator for Ninja 7 built so it can be downloaded? Couldn't find it in the fileshare and I'm not capable of making a new indicator using the parameters suggested on this thread.
Thanks!


Reply With Quote
  #8 (permalink)
 
Slipknot511's Avatar
 Slipknot511 
Springfield,Missouri, USA
 
Experience: Advanced
Platform: NinjaTrader (It's a love/hate relationship)
Trading: CL, TF, 6E
Posts: 169 since May 2010
Thanks Given: 60
Thanks Received: 315


SawDr View Post
Does anyone have this indicator for Ninja 7 built so it can be downloaded? Couldn't find it in the fileshare and I'm not capable of making a new indicator using the parameters suggested on this thread.
Thanks!


Look for the indicator "Colored Time Zones" on this page. Works on 6.5 and 7.


Reply With Quote
Thanked by:
  #9 (permalink)
 bill897 
U.S.A.
 
Experience: Advanced
Platform: NinjaTrader
Posts: 19 since May 2010
Thanks Given: 5
Thanks Received: 11

I'm having a problem testing the following:
if (ToTime(Time[
0]) <= 80000 || ToTime(Time[0]) >= 134500){ return;}.
I'm in backtest101. Is it true that you can only test ToTime
in real time instead of backtesting. I should be getting zero data in my
Strategy Analyzer. Instead it's like the ToTime didn't work. In my test data
it says I have a profit when I shouldn't have any profit because the computer
time is 205400 which is greater than the 134500 end time. The system should
not give me any profit. But it's as though the ToTime didn't work. Maybe I
have to test this in sym. Any opinions would be welcome.


Attached Thumbnails
Click image for larger version

Name:	bg_Main.jpg
Views:	345
Size:	540.1 KB
ID:	25939  
Reply With Quote
  #10 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,759 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,647


Your problem is somewhere else, not in this "if ...", which is correct.
Maybe you are entering only in this time windows, but never check the time for the exits ?


Success requires no deodorant! (Sun Tzu)
Reply With Quote




Last Updated on June 2, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts