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
Room to run?
Collapse
X
-
Ok, I dont have it figured out.
I was trying to take trades on the 5minute (MES) based on this secondary series to see if there is room to run on a lower time frame (1minute MES) between price and the bollingers but its not working. Its acting like there is never a price difference between the price and the bollinger.
This picture's simple condition never goes true, it never paints the background.
I'm specifically telling it to watch the 5 minute and 1minute while I'm looking at the 5min chart.
I'm guessing I just dont have it set up right? thanks
Last edited by ezrollin; 10-08-2022, 10:13 AM.
Comment
-
Hello ezrollin,
Thank you for your reply.
I suggest adding a print statement to see if the condition is triggered as well as get the time when it was triggered. I have set up the same added data series and the following condition and action, and when I enable the strategy on an ES 12-22 chart I do see prints in the NinjaScript Output window in addition to the BackBrush being changed. I have created some screenshots to demonstrate:
Additional Data - https://www.screencast.com/t/1TqGqwYYpR5
Conditions and Actions - https://www.screencast.com/t/qcqzZPfZ8
Print edit page - https://www.screencast.com/t/mtKdD5eSs8
Output and BackBrush - https://www.screencast.com/t/4GwDyzHluJyH
For more information about using prints to debug your code, please see the following post and link to a video showing how to add prints to the Strategy Builder:
Please let us know if we may be of further assistance.Emily C.NinjaTrader Customer Service
Comment
-
Top panel is my 5minute (looking for high/low breakouts)
Bottom is my 1minute panel (looking for room in the bollingers)
My issues:
1) Changing the background color should only be applied to the bottom 1 minute chart because thats the one we're trying to base the Bollinger Band upper/lower space on
(the CONDITION is based on the 1minute as you can see) but you can only apply BackBrush to the top panel or all panels (not the lower panel or the Condition's panel)
2) (same problem as #1) Printing the debug is printing based on the top 5minute panel, not the panel where the CONDITION has been added!!!!!!!!
so its printing in 5minute intervals instead of the 1minute Bollinger Band space I specified
Why is it disregarding that I SPECIFIED Data Series time intervals?
This has been my problem from day 1 ThanksLast edited by ezrollin; 10-13-2022, 10:11 PM.
Comment
-
Hello ezrollin,
Thank you for your reply.
Is the 1-minute panel something you are manually adding to your chart to see visually? The Strategy Builder will give you the option of BackBrushAll to change the background for all chart panels, or BackBrush to change only the panel of the input series for the strategy. You would not be able to change only the BackBrush of the 1-minute data series since it appears that the 5-minute data series is the input series for your strategy.
BackBrush: https://ninjatrader.com/support/help.../backbrush.htm
BackBrushAll: https://ninjatrader.com/support/help...ckbrushall.htm
Additionally, when using the Strategy Builder the OnBarUpdate() method is only called for the primary data series. There is a line of code that says:
if (BarsInProgress != 0)
return;
This means that it will ignore OnBarUpdate() for any added data series. For more information about working with multiple time frames:
Ultimately, what you are looking to achieve should be possible using a custom indicator as well as unlocking your strategy from the Strategy Builder and coding it directly in the NinjaScript Editor (this is due to the BarsInProgress limitation of the Strategy Builder). If you are interested in working on this yourself, I would be glad to provide you with additional resources to assist. Otherwise, I could get you in touch with out Vendor Support team for more information about NinjaScript consultants who may be able to develop this for you. Please let me know if one of these options interests you and I will follow up accordingly.
I look forward to your reply.Emily C.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Emily View PostIs the 1-minute panel something you are manually adding to your chart to see visually?
Originally posted by NinjaTrader_Emily View PostHello ezrollin,
The Strategy Builder will give you the option of BackBrushAll to change the background for all chart panels, or BackBrush to change only the panel of the input series for the strategy.
Originally posted by NinjaTrader_Emily View Post
Additionally, when using the Strategy Builder the OnBarUpdate() method is only called for the primary data series. There is a line of code that says:
if (BarsInProgress != 0)
return;
This means that it will ignore OnBarUpdate() for any added data series. For more information about working with multiple time frames:
https://ninjatrader.com/support/help...nstruments.htm
but you can apply your strategy to your chart's data series and specify that builder incorporate another hidden data series?
Can we vote that this gets changed in future versions to where it can work on 2 data series at the same time in builder? thanks
Comment
-
Hello ezrollin,
Thank you for your reply.
Even with an unlocked strategy, you are not able to visually plot an added data series. As a workaround to this, you could potentially add an indicator that plots in an additional panel, and you could code the indicator to plot the equivalent values of the bars from a data series; I just wanted to clarify in case you are interested in working with an unlocked indicator and adding it to a strategy.
As far as the ability to work with different BarsInProgress other than just the primary series in the Strategy Builder, this has been submitted as a feature request to our development team. I will follow up with an internal tracking number for your reference as soon as it is created.
"but you can apply your strategy to your chart's data series and specify that builder incorporate another hidden data series?"
You can apply the strategy to any data series on a chart, and yes you could add more than one additional data series to your strategy, even in the strategy builder. If you want the OnBarUpdate() method to be processed more frequently, you would want to add the strategy to a more granular data series. In your case, I believe you are applying the strategy to a 5-minute chart. The strategy adds a 1-minute data series, but since it is on a 5-minute primary series OnBarUpdate() is only called every 5 minutes. If you are looking to use logic based on both a 1-minute and 5-minute series, you may want to consider adding both of those values to the strategy itself as well as applying the strategy to a granularity as small as at least a 1-minute chart data series to ensure that OnBarUpdate() is running as frequently as needed.
Thank you for your patience.Emily C.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AaronKoRn, Today, 09:49 PM
|
0 responses
7 views
0 likes
|
Last Post
by AaronKoRn
Today, 09:49 PM
|
||
Started by carnitron, Today, 08:42 PM
|
0 responses
9 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
10 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,980 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
9 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
Comment