Add Secondary Price Bars of Any Bar Type Supported in a NinjaTrader® NinjaScript® Strategy to a Quagensia® N Edition Strategy

The Basics of Using Secondary Price Bars in a Quagensia N Edition Strategy

You can use secondary price bars in your Quagensia® N Edition Strategies to enable your strategies to run on a main set of price bars but access data from a second, third, fourth, or higher order set of “secondary price bars”.

For example, you can create a strategy that uses the daily price bars for a single stock as its primary price bars, but your strategy can also consider the high or low prices of a “secondary” set of price bars, such as the daily price bars of gold futures or the monthly price bars of the same stock on whose daily data your strategy is using as its primary price bars.

The NinjaTrader® Desktop platform provides excellent support for NinjaTrader® strategies that use secondary price bar data series in their trading logic. You can read the official Ninjatrader® Help Guide’s Multi-Time Frame & Instruments topic to get a deeper understanding of the concepts involved with trading strategies that use secondary price bars in NinjaTrader.

Quagensia N Edition allows you to create an Internal Variable of type “Secondary Price Bars” in a Quagensia N Edition Strategy that creates a secondary price bar time series in your NinjaTrader strategy. A secondary price bar time series can have a different symbol, a different bar period, or a different symbol and bar period than the main set of price bars, i.e. the “primary price bars”, on which your strategy runs.

See the Using Secondary Price Bars in a Quagensia N Edition Strategy help page to learn more about adding Secondary Price Bars to a Quagensia N Edition Strategy generally. Most of the topics on that help page apply to doing this using either the standard no-code user interface or doing this using the advanced user interface by pasting a line of NinjaScript code into a text box (which is the specific topic of the help page you are reading now).

You can add Secondary Price Bars of *any* bar type supported in a NinjaTrader NinjaScript Strategy by pasting a single line of NinjaScript code into a text box in Quagensia N Edition.

When you click the button labeled “Paste a Line of Code into a Text Box Instead to Add Secondary Price Bars of *Any* Bar Type Supported in NinjaScript® (Advanced)” at the bottom of the user interface of a Secondary Price Bars Internal Variable in the Internal Variables grid of a Quagensia N Edition Strategy, the standard no-code user interface for adding Secondary Price Bars will be replaced with an advanced user interface that has a text box where a line of NinjaScript code can be pasted to add a Secondary Price Bars Internal Variable (i.e. a secondary data series) of any bar type that supports being added to a NinjaTrader NinjaScript strategy with a line of NinjaScript code, including secondary data series of the following bar types:

  1. Volumetric Bars (Using the “AddVolumetric” Function)
  2. Renko Bars (Using the “AddRenko” Function)
  3. Heiken Ashi Bars (Using the “AddHeikenAshi” Function)
  4. Kagi Bars (Using the “AddKagi” Function)
  5. Line Break Bars (Using the “AddLineBreak” Function)
  6. Point and Figure Bars (Using the “AddPointAndFigure” Function)
  7. Price on Volume Bars (Using the “AddPriceOnVolume” Function) (We at Quagensia know of no official help page for the “AddPriceOnVolume” function.)
  8. Delta Bars (Using the “AddDataSeries” function like the following, where 15 is the Order Flow Delta bar type, Value is the Trend Delta, and Value2 is the Trend reversal:
    • AddDataSeries(null, new BarsPeriod() { BarsPeriodType = (BarsPeriodType)15, Value = 500, Value2 = 500 });)
  9. Custom Bar Types from Third Parties (Using a Line of Code Provided by the Third Party)

Secondary Price Bars Internal Variables added with a line of code can be used in all of the no-code ways that Secondary Price Bars Internal Variables that are added using the standard no-code user interface can be used in all other locations in a Quagensia N Edition Strategy without any additional code.

Getting Help with Creating the Line of NinjaScript Code to Paste Into the Text Box in Quagensia N Edition to Add a Specific Type of Secondary Price Bars

Option #1: Self-Help

If you are somewhat technical or would like to try to figure out the line of code to paste into the text box in Quagensia N Edition on your own and the bar type of the secondary data series of interest is mentioned specifically in the text on this page and the text includes a link to a web page on the ninjatrader.com website that provides documentation on the NinjaScript function required to add a secondary data series of the specific bar type to a NinjaScript strategy, then you can click the link, read the NinjaScript help page on the ninjatrader.com website, and attempt to figure out the line of NinjaScript code on your own.

Option #2: The Quagensia Discord Community

If you would like to see the lines of NinjaScript code that other Quagensia N Edition users have used to successfully add a Secondary Price Bars Internal Variable using the advanced user interface described on this help page and request help from other Quagensia N Edition users, the Quagensia Discord Community is the best place to do this.

Option #3: Use A Paid NinjaScript Consultant or Technical Colleague (*Without* Sharing the Rest of Your Trading Logic)

Quagensia N Edition is an excellent choice for a no-code strategy builder for working with paid NinjaScript consultants or technical colleagues without sharing any of the trading logic of your trading strategy that these individuals do not absolutely need access to in order to help you. For instance, you can either 1) have a consultant or technical colleague email you the specific line of code you need to paste into the text box, or 2) you can have them send you a Quagensia N Edition Strategy file via email or other file sharing technique whose entire contents consist of one Internal Variable of Type “Secondary Price Bars” in the Internal Variables section with this line of code filled in. If they send you a Quagensia N Edition Strategy file you could then either 1) copy and paste the entire Internal Variable of Type “Secondary Price Bars” from their otherwise empty Quagensia N Edition Strategy into your Quagensia N Edition Strategy full of your secrets and proprietary trading logic using the inter-strategy copy-and-paste feature available from the “gear icon” to the left of the rows in the Internal Variables grid of your and their Quagensia N Edition Strategies or 2) you could just manually copy the line of code from the text box in their Quagensia N Edition Strategy and paste it into your Quagensia N Edition Strategy’s text box.

There are many NinjaScript programming consultants that you can hire to help you build your strategy without code in Quagensia N Edition. There is a list of potential NinjaTrader NinjaScript consultants on the NinjaTrader Ecosystem website, and there are other lists on the internet as well, like the NinjaScript consultants at Upwork.

Volumetric bars and “Price on Volume” bars do not come free with the free version of NinjaTrader.

Both the Volumetric and Price on Volume bar types require payment of some kind, such as a paid NinjaTrader license or a paid subscription to an add-on that you can learn more about on the NinjaTrader website. You can learn more on the Subscribing to the Order Flow+ Add-On help page on the ninjatrader.com website.

Building Strategies for NinjaTrader that Use the Volumetric Data of the NinjaTrader Order Flow “Volumetric” Bar Type without Code using Quagensia N Edition

You can quickly add no-code trading logic to a Quagensia N Edition Strategy for NinjaTrader® that “looks inside of price bars” by using the no-code functions that provide access to the numeric “volumetric” information that each bar of a NinjaTrader Order Flow “Volumetric” bar data series (also called “footprint” or “TPO” bars) makes available to NinjaScript® strategies. To learn more, see the Using NinjaTrader® Order Flow Volumetric Bars and Footprint Charts in NinjaTrader® NinjaScript® Strategies Without Code help page.

Submit your high-quality Quagensia tutorials for consideration for free inclusion on our website.

If you publish high-quality Quagensia tutorials on a social media platform like YouTube, please consider submitting them to us. We may promote them for free by linking to them from relevant pages on our website.

To submit your Quagensia tutorials for consideration for free inclusion on our website, use the How to Submit Your Quagensia-Enhanced Content page. We are available by phone or email to help you create, publish, and promote Quagensia-enhanced content. You can also get questions answered in our Content Creator Support Center and in the official Quagensia® Discord community’s content-creators channel.

Thanks for Sharing!

Ready to get started?

Download the Quagensia no-code strategy builder free trial and build your trading strategies now.

Under a dollar a day.

Priced to be an easy decision for most traders.

Join Us on Discord

Build point-&-click strategies for NinjaTrader® and TradeStation® using Quagensia®. Collaborate with other traders to get and give help, build and backtest strategies together, and grow your skills.

Subscribe to our Newsletter

We'll send you product updates and company news from Quagensia as well as curated lists of Quagensia-enhanced content.

Welcome
Content Creators

Quagensia enables content creators to make interactive content. We invite you to create Quagensia-enhanced content and share it on YouTube and other social media channels. You may submit your high-quality Quagensia-enhanced content for consideration for free inclusion on our website.

Screenshots

For larger and additional screenshots, see large Quagensia N Edition screenshots (for NinjaTrader®) and large Quagensia T Edition screenshots (for TradeStation®).

For additional screenshots, see the list of Strategies Built into Quagensia N Edition (for NinjaTrader®) and Strategies Built into Quagensia T Edition (for TradeStation®). Select a built-in strategy that interests you and scroll down for the screenshot. Then scroll up to the top of the page and click the “Overview” link to watch the video on how to use that built-in strategy.

This is a screenshot of the point-and-click trading strategy you will build in Quagensia N Edition (for NinjaTrader®) if you follow along with the video titled Create NinjaTrader® Strategies Using Point-&-Click with Quagensia N Edition – Full Tutorial.

This is a screenshot of the point-and-click trading strategy you will build in Quagensia N Edition (for NinjaTrader®) if you follow along with the video titled "Introduction to Quagensia N Edition".

Click the gear icon that appears when you place your mouse pointer over the location to which you would like to add trading logic. A context menu will appear with filtered options to choose from.

Click the gear icon that appears when you place your mouse pointer over the location to which you would like to add trading logic. A context menu will appear with filtered options to choose from.

Thanks for Sharing!

Ready to get started?

Download the Quagensia no-code strategy builder free trial and build your trading strategies now.

Under a dollar a day.

Priced to be an easy decision for most traders.

Join Us on Discord

Build point-&-click strategies for NinjaTrader® and TradeStation® using Quagensia®. Collaborate with other traders to get and give help, build and backtest strategies together, and grow your skills.

Subscribe to our Newsletter

We'll send you product updates and company news from Quagensia as well as curated lists of Quagensia-enhanced content.

Welcome
Content Creators

Quagensia enables content creators to make interactive content. We invite you to create Quagensia-enhanced content and share it on YouTube and other social media channels. You may submit your high-quality Quagensia-enhanced content for consideration for free inclusion on our website.