NexusFi: Find Your Edge


Home Menu

 





compilation error C0119


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one elechim72 with 2 posts (0 thanks)
    2. looks_two Koepisch with 1 posts (1 thanks)
    3. looks_3 DTSio with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 1,441 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

compilation error C0119

  #1 (permalink)
 elechim72 
Geniva, Switzerland
 
Experience: Beginner
Platform: NinjaTrader
Trading: ZB
Posts: 6 since Jul 2012
Thanks Given: 3
Thanks Received: 1

Hello,

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.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
 
  #3 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518


@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.

Koepisch

Reply With Quote
Thanked by:
  #4 (permalink)
 elechim72 
Geniva, Switzerland
 
Experience: Beginner
Platform: NinjaTrader
Trading: ZB
Posts: 6 since Jul 2012
Thanks Given: 3
Thanks Received: 1

I find the solution by myself:

Print(PriceActionSwing(15, 7, SwingTypes.Standard).LowerLow[0]);

instead

Print(PriceActionSwing(15, 7, PriceActionSwing.Utility.SwingTypes.Standard).LowerLow[0]);

Started this thread Reply With Quote
  #5 (permalink)
DTSio
Ocala Florida
 
Posts: 6 since Oct 2021
Thanks Given: 0
Thanks Received: 0

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

PriceActionSwingOscillator1 = PriceActionSwingOscillator(Close, PriceActionSwing.Base.SwingStyle.Standard, 7, 20, false, PriceActionSwing.Base.Show.Relation, true, false, false);


i believe is in these 1 parts

PriceActionSwing.Base.SwingStyle.Standard

PriceActionSwing.Base.Show.Relation

using the post above likely "Base"

Thanks for any insights

message was

'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

Reply With Quote




Last Updated on October 23, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts