Post your code so we can see how far you are and where you are stuck.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The use of daily price bars in parallel with intraday price bars in NinjaTrader is probelmatic. Let me give an example first:
Example 1: segmented session
Chart 1 shows a multi bar series chart of YM 06-11. The session template divides the day into 2 subsessions, the night session and the day session. The daily data comes from Kinetick EOD.
Problem here is that the daily bars are time-stamped at 15:30 CET (Central European Time). This is the start of the RTH session. The correct time-stamp would be 22:15 CET. As you can see from the indicator that I added on the chart, it does not display the daily close (settlement) of the pior day correctly.
Example 2: non-segmented session
Chart 2 uses a non-segmented session template, which means one session per trading day. As you can see the time-stamp of the daily bars are correct and the daily data is added correctly.
If you want to add daily data to an intraday data bar series you should pay attention that the session template under instrument settings is non-segmented, otherwise NinjaTrader will not add daily data properly.
Have you considered the option to add minute bars with a bar period of 1440 minutes? You would be on the safe side.
I have added the indicator below, which you can use to test the behavior on NinjaTrader.
Last edited by Fat Tails; June 9th, 2011 at 08:18 AM.
The following 2 users say Thank You to Fat Tails for this post:
Thanx for the effort. However, my problem is not displaying data on the chart ... it's rather about computing data using different Time Values and using it as a Filter. For example, if I set a Filter to trade only during those days when Price (5 min) > SMA10 (days) > SMA50 (days), than I need to access the value of 3 variables (Price is minute based, while SMA is based on daily closing prices). Unfortunately, after reading all related materials on this Board, I still don't know how to do it.
It would be a lot easier if Ninja Trader guys would just insert the „Time Value“ field within each Parameter, so you can choose individual values for each indicator, instead of having only one „Period Value“ for all Parameters.
The following user says Thank You to jdumanic for this post:
Whether you use an indicator on a chart or use a strategy without a chart, the instrument will use its underlying session template. I only wanted to show that there is a NinjaTrader bug, which prevents the use of daily bars and intraday bars, if you use a segmented session template. Just used the chart, because it explains the problem better than lots of data extracted from a strategy.
In case that you use a simple session template there is no problem and it is feasible.
If you describe a simple strategy, I can have a look at it.
Btw, when I do all this the Ninja Script sends an "error" message, so most likely I'm doing something wrong. Programming in C.# is really difficult (and frustrating) for someone w/o any programming experience (:
It is a long way to go, I am not a programmer either. Best you buy a book with the basic stuff (250 pages), work through it, install the free Microsoft Visual C# Express Edition and go through all the exercises in this book. Once you have done that, progress will be fast, you just need to look how others are coding indicators and strategies and copy and paste. After some time the copy and paste approach will automatically vanish and be replaced with your own ideas and coding style.
This post has been selected as an answer to the original posters question
If the second post did not answer your question, then try studying this indicator code. All it does is add a second bar series, use that second series as the input to two SMA functions and save the comparison result, which is available as an external variable.
You can apply the same principle in your strategy code.
Bear in mind that this does not address the concern that Fat Tails raised: regardless of where you use the data (chart or strategy code) if you are not careful with your session template, the data will be wrong.
The following 2 users say Thank You to LostTrader for this post: