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!
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
NinjaTrader
Multi-time frame strategy with periods of different size
Collapse
X
-
pequemec,
You can't use [0] the way it works out of the box because you are skipping bars with your time filter. You need to program logic that uses only the series at points you want for your calculations. Unfortunately this would require some more extensive programming to achieve. You may want to consider one of these 3rd party NinjaScript Consultants here: http://www.ninjatrader.com/webnew/pa...injaScript.htm
-
Ok, How do I maintain the continuity of the indicator?
Sorry but I'm not a programmer
Leave a comment:
-
I'm not sure I follow what you mean 'with gaps of 0's', but for sure it will disrupt indicator continuity the way you programmed it as it does not have enough data to initialize calcs properly at time filter start.
Leave a comment:
-
Suppose we apply that logic in the indicator Bollinger. Syntax:
protected override void OnBarUpdate()
{
//Filtro temporal
if (ToTime(Time[0]) > 153000 && ToTime(Time[0]) <= 221500)
miscierres.Set(Close[0]);
else
return;
BandaSuperior.Set(SMA(miscierres, periodo)[0] + desvest * StdDev(miscierres, periodo)[0]);
BandaMedia.Set(SMA(miscierres,periodo)[0]);
BandaInferior.Set(SMA(miscierres, periodo)[0] - desvest * StdDev(miscierres, periodo)[0]);
}
What happens is that you fill the "gaps" of zeros. How do I fix?
Leave a comment:
-
pequemec,
How we have been outlining is how it works. It will work for what you have outlined. You need to use time filters. You can either get the indicator logic into the strategy directly like Austin mentioned or you can program the time filter into the indicator directly. Unfortunately there is no way around this. 7 works exactly the same way.
Leave a comment:
-
Sorry, but for me this is not a good solution. Could you tell me as they have solved this in version7?. It's as simple as documenting the logic that I use to create a strategy multitimeframe with different sessions for each BarsInProgress.
Leave a comment:
-
pequemec, what you seek will require you to code the entire indicator into your strategy and then wrap the time filters around it. This will most likely not be an easy task. You can use the ToTime() function to quickly verify if the time is during some period like this:
Code:if (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 160000) { // the time is between 9:30am and 4pm // you can set your indicator logic to only run during this time period }
Leave a comment:
-
Josh,
What type of filter would be? The filter of the type:
if (ToTime (Time [0]) <= 153000) return;
remove plot lines but do not alter the value of the indicator.
Leave a comment:
-
pequemec,
Indicators always run on the full information displayed on the chart. If you only want it to use a subset you need to program a time filter into the indicator itself (not the strategy) to be able to allow the strategy to trade on the full hours. It may require more adjusting of indicator logic to accommodate not setting certain bars.
Leave a comment:
-
Thanks for your reply.
A time filter is not the solution because the problem is not to establish a time period for the trades, is to establish a time period for the indicators.
Is it possible in NinjaTrader7?
If this is possible please indicate the detailed logic.
Best regards.
Leave a comment:
-
Hi there, unfortunately this isn't possible with NinjaTrader 6.5 unless you create some sort of time filter that only lets your strategy trade during certain time periods.
Leave a comment:
-
Multi-time frame strategy with periods of different size
Hi,
I appreciate any help and I'll try to explain in English:
I'm programming a multi-time frame strategy, in 15min bars, for the ES instrument in RTH. I apply a filter in 3min bars, to specify the entries, but I need to take several bars outside RTH. I can not change session begins and session ends in the main chart without modify the parameters of the indicators used and discredit the system. How can I incorporate these bars outside RTH in my strategy?
Best regards.
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rocketman7, Today, 09:41 AM
|
3 responses
7 views
0 likes
|
Last Post Today, 10:07 AM | ||
Started by traderqz, Today, 09:44 AM
|
2 responses
4 views
0 likes
|
Last Post Today, 10:00 AM | ||
Started by stafe, 04-15-2024, 08:34 PM
|
8 responses
40 views
0 likes
|
Last Post
by stafe
Today, 10:00 AM
|
||
Started by rocketman7, Today, 02:12 AM
|
7 responses
31 views
0 likes
|
Last Post Today, 09:23 AM | ||
Started by guillembm, Yesterday, 11:25 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 09:11 AM |
Leave a comment: