View Full Version : Wick colors for daily bars
yellowTrader
02-03-2010, 12:26 PM
Hi , I'm trying to use either one of the codes below to paint Candle Outline color but it doesn't work on daily bars. but it does work on intraday bars.
Can you please tell me what I am doing wrong?
if (ToDay(Time[0]) == ToDay(2010, 2, 1))
{
if (ToTime(Time[0]) >= ToTime(0, 0, 1)
&& ToTime(Time[0]) <= ToTime(23, 59, 59))
CandleOutlineColor = Color.Blue;
}
or I use
if (ToDay(Time[0]) == ToDay(2010, 2, 1))
CandleOutlineColor = Color.Blue;
NinjaTrader_Josh
02-03-2010, 02:10 PM
I used your exact code on the bottom and it works on my chart. Can you please clarify? Thank you.
yellowTrader
02-04-2010, 07:38 AM
I had set the session template in session manager to Default 24/7 . I think this was causing the problem.
I fixed the issue by changing the session template in Data Series window from "Use Instrument settings" to some other settings.
Can you explain why the code doesn't work in Default 24/7?
I use this session template on almost all of my charts.
NinjaTrader_Josh
02-04-2010, 08:55 AM
Default 24/7 works fine for me here as well and it should not be a factor. What I suggest you to do is mouse over your bars and look at each bar's timestamp to see if you find a bar that matches whatever you have coded.
If you are using Default 24/7,
if (ToTime(Time[0]) >= ToTime(0, 0, 1)
&& ToTime(Time[0]) <= ToTime(23, 59, 59))
Would not necessarily work depending on the timezone you are in.
yellowTrader
02-04-2010, 09:43 AM
Would you please follow these steps and tell me if you get the same results?
1- Go to the instrument manager and set the session template of ES 03-10 to "Default 24/7" . Then when opening a daily chart set the session template in the data series window to "Use Instrument Settings" .
Now with the middle button of your mouse hover over the fourth bar from the left which is the daily bar for Monday. What does the timestamp say?
Mine says 2/2/2010 . which is wrong Moday is Feb/1st/2010.
That's why the indicator you sent (above) doesn't work because it's set to 2/1/2010.
I changed it to 2/2/2010 and now it worked.
The question is : why is NT registering wrong daily time stamps when Default 24/7 is used?
NinjaTrader_Josh
02-04-2010, 10:21 AM
Depends on which timezone you are in. Default 24/7 is a session based off of EST. How those timestamps come up depends on your timezone and its relationship versus EST as the end timestamp of daily bars goes by the EST converted equivalents for your timezone.
yellowTrader
02-04-2010, 10:25 AM
I am in EST time zone.
Did you get the same result?
Is Monday's time stamp shown to be 2/2/2010 at your end?
NinjaTrader_Josh
02-04-2010, 10:32 AM
If you are in EST this is accurate behavior. Timestamp would be 2/2 00:00 for Monday as that is when the bar ends. Why it says 2/2 is simply a caveat of clocks and time when you try to base 24 hours off of midnight as the date change time.
yellowTrader
02-04-2010, 10:50 AM
Hmm.. SO you mean when writing codes I should always use tomorrows date ? and always use the wrong date?
Next issue is that when I open two daily charts , one with Default 24/7 and the other with CME Global Futures RTH , They both have the same open, High, Low, Close.
Why is that? Isn't the bar supposed to be defined by the defined period in that session template?
NinjaTrader_Josh
02-04-2010, 11:00 AM
1. When in EST, that is the caveat of using Default 24/7. Unless you want to create yourself a new 24/7 session template that puts the session break at a time other than midnight that will be the case.
2. Daily data pulled from our servers are built from the RTH sessions. That is likely what you have in your data and that is why you see it like that.
yellowTrader
02-04-2010, 11:25 AM
I'm sorry I don't understand. Did you say "data pulled from your servers..." ?
I thought I get my data from esignal and IB.
The question is what can I do so that my daily charts are constructed with the defined sessions I provide? Anotherwords have the proper O, H, L , C, V based on the defined session?
NinjaTrader_Josh
02-04-2010, 12:04 PM
My mistake. I thought you were using a different feed. If you are using eSig and IB it just pulls from those providers and whatever is provided by them is what you will get. It will not necessarily be based on your session definitions.
yellowTrader
02-04-2010, 12:22 PM
Josh, you did not answer my question. Would you please tell me how it can be done?
The question is what can I do so that my daily charts are constructed with the defined sessions I provide? Anotherwords have the proper O, H, L , C, V based on the defined session?
NinjaTrader_Josh
02-04-2010, 01:18 PM
eSig and IB offer you native daily data. You see whatever is downloaded from your data provider and whatever they decide is the OHLCV for the bars is what you will get.
If you really want your own, then you would have to import a data set that has it the way you want to see it. Otherwise you can try using tricks like 1440min charts for 24hrs.
yellowTrader
02-04-2010, 01:24 PM
Thank you. That was very helpful.