Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I really have a hard time figuring out how to use Filters in my Strategy which have different time frames than my primary indicators.
For example, I want to trade using 5 min price bars indicators, but only during those days when 10 DAY moving average > 50 DAY moving average (Filter).
Hence, my trouble is setting up Filters using DayPeriods while other indicators should have MinutePeriods. Any ides?
Thanx
Jere
Can you help answer these questions from other members on NexusFi?
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.
Conclusion
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.
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.
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 (:
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.
For example, I want to trade using 5 min price bars indicators, but only during those days when 10 DAY moving average > 50 DAY moving average (Filter).
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.
Elite Membership required to download: jereFilter.zip
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.
This helps a lot. I understand the script logic much better now. Big thanx