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 want to use the PriceActionSwing indicator in strategy.
For example:
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
using PriceActionSwing.Utility;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class TestStrategy : Strategy
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{ Print(PriceActionSwing(15, 7, PriceActionSwing.Utility.SwingTypes.Standard).LowerLow[0]); }
#region Properties
#endregion
}
}
Unfortunately the CS0119 compile error:
NinjaTrader.Strategy.Strategy.PriceActionSwingPro(int, int, PriceActionSwingPro.Utility.SwingTypes)' is a 'construct1', which is not valid in the given context.
Will you help me.
Can you help answer these questions from other members on NexusFi?
@elechim72: When you post source code, you can use a specific function from the "new quote" tool bar. Hover over the icon's and you will find it. Then your code will be indented properly.
I see has been many years since this post but if anyone else has tried this in the strategy and solved the issue I would appreciate your insight. I am having a similar issue with one of the sister indicators as well
'NinjaTrader.NinjaScript.Strategies.Strategy.PriceActionSwing(PriceActionSwing.Base.SwingStyle, double, int, bool, PriceActionSwing.Base.SwingLengthStyle, PriceActionSwing.Base.SwingDurationStyle, bool, bool, bool, PriceActionSwing.Base.SwingTimeStyle, PriceActionSwing.Base.SwingVolumeStyle, PriceActionSwing.Base.VisualizationStyle, NinjaTrader.Gui.Tools.SimpleFont, int, int, int, int, int, int, NinjaTrader.Gui.DashStyleHelper, int, bool, bool)' is a 'method', which is not valid in the given context