Creating Algorithmic Trading Strategies with Quagensia N Edition for NinjaTrader 8

Spread the love

This tutorial provides a comprehensive guide on how to create, back-test, and optimize strategies using N Edition for 8 without any coding. It covers the step-by-step process of building a simple strategy, generating code, and analyzing back-test results.

N Edition simplifies the process of creating strategies for 8 without the need for coding. By using a point-and-click interface, users can easily translate their trading ideas into actionable strategies. This tutorial will guide you through building a basic strategy, back-testing it, and optimizing it using historical market data.

Getting Started with N Edition

Before diving into strategy creation, ensure you have installed the N Edition free trial. Once installed, the trial period begins, allowing you to explore all features and create as many algorithms as possible. Even after the trial ends, the generated strategy code remains yours to use on multiple computers.

Installing N Edition

  1. Visit quagensia.com to download the free trial.
  2. Follow the installation instructions.
  3. Restart this tutorial video after installation to follow along.

Creating a New Strategy

To create a new strategy in Quagensia:

  1. Click the “Plus” icon on the left side of the toolbar.
  2. Select “Create New Quagensia N Edition Strategy”.
  3. Name your strategy and set a short name for 8.
  4. Save the strategy in the “My Algos” folder.

Setting Up Strategy Details

In the Strategy Details section, configure the following properties:

  • Calculate: Set to “On Bar Close” to execute trading logic only when price bars close.
  • Default Entry Order Quantity: Set to 100 for equities.
  • Exit on Session Close: Uncheck this box to hold positions overnight.
  • Slippage: Set to 2 to avoid overly optimistic back-test results.

Defining Input Parameters

Next, define input parameters for your strategy:

  1. Fast MA Period: Set as a whole number with an initial value of 3.
  2. Slow MA Period: Set as a whole number with an initial value of 6.

Quagensia supports various data types for input parameters, including advanced types like dates, colors, and lists.

Creating Internal Variables

Define internal variables to store values used in your strategy’s logic:

  1. Fast MA: Create an internal variable of type “Indicator Time Series” for the fast moving average.
  2. Slow MA: Create another internal variable for the slow moving average.

Use the context-sensitive menu to select indicators and set their properties. For example, choose the weighted moving average (WMA) for the Fast MA and the triangular moving average for the Slow MA.

Building Trading Logic

In the “When Bar Updates” section, create the logic for your strategy:

  1. Add a “Conditional Logic (If Block)” action.
  2. Set conditions for entering a long position:
  • Ensure the current market position is flat.
  • Check if the Fast MA crossed above the Slow MA.
  • Verify that the last two bars have higher lows than their previous bars.
  • Restrict signals to occur only on Monday or Tuesday.

Adding Actions for Entry

When the conditions are met, specify actions to take:

  1. Enter a long position using a market order.
  2. Change the candle outline color of the signal bar.
  3. Draw a diamond above the high of the signal bar.
  4. Print the entry close price to the Output window for debugging.

Creating Exit Logic

To manage exits, add an “Otherwise, If (Else If)” block:

  1. Check if the Fast MA crossed below the Slow MA while in a long position.
  2. Exit the entire long position using a market order.
  3. Copy and paste relevant actions from the entry logic to maintain consistency in logging and drawing.

Generating Strategy Code

Once your strategy is complete, generate the code:

  1. Open 8 and the Editor.
  2. Click the button in Quagensia to send the strategy code to .
  3. Ensure the code compiles successfully without errors.

Back-Testing the Strategy

To back-test your strategy:

  1. Connect to a market data feed in NinjaTrader.
  2. Open the Strategy Analyzer and set the back-test parameters:
  • Choose the instrument (e.g., SPY).
  • Set the date range for back-testing.
  • Configure slippage and order quantity settings.
  1. Run the back-test and analyze the results.

Analyzing Back-Test Results

Review the back-test results, focusing on key metrics such as profit factor and cumulative net profit. Use the NinjaTrader Strategy Analyzer to visualize trades on a chart and assess performance over time.

Optimizing the Strategy

To optimize your strategy:

  1. Change the back-test type to “Optimization”.
  2. Set the parameter ranges for Fast MA and Slow MA periods.
  3. Run the optimization to evaluate multiple combinations quickly.

Conclusion

Congratulations! You have successfully created, back-tested, and optimized a basic using Quagensia N Edition for . This tutorial only scratches the surface of what Quagensia can do. For more advanced features and strategies, explore additional tutorials available on the Quagensia website.

By leveraging the capabilities of Quagensia N Edition, traders can develop complex strategies without coding, making more accessible than ever.


Our Pick
Quagensia's Point and Click Strategy Builder • Strategy Apex

Quagensia's Point and Click Strategy Builder • Strategy Apex

Zig Zag Strategy Template Available for download

Related Posts

Leave a Reply