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)
you have to create an eventhandler for that in the dll. when you create an object in ninjascript (from the dll), just raise the event. that will do the trick.
Can you help answer these questions from other members on NexusFi?
well bukkan its been a while and here i am trying this again;
So i build a form and it loads in ninja, in the code in visual studio i have this.
circularPointer1.Value = 40;
ithe whole thing is exported as a dll
now in ninja i get the form to open by doing
TimmybForm1.show();
the guage is there and everything, but for the life of me i cant get the guage to display a number with anything i try in ninja
its like it doesnt know its there, i have tried a ton of things and i am now frustereated and lost after 4 hours of struggling. any advice would be great.
I dont have the dundas stuff so cant test. But do numericIndicator1.Value returns a double or a decimal. If it is a decimal please modify your code like:
@timmyb, couldn't you create the form itself within NT (i.e., copying and pasting the Visual Studio code into the indicator), and reference the needed Dundas dll's from the Form/Indicator?
@timmyb, couldn't you create the form itself within NT (i.e., copying and pasting the Visual Studio code into the indicator), and reference the needed Dundas dll's from the Form/Indicator?
Yes that is what I do now. But my forms are becoming more advanced. So if I can get a dll to work then my life would be easier
Thanks bukken will try that tonight and post issues. I know I can get things to compile but no movement. Thanks tim
Yes that is what I do now. But my forms are becoming more advanced. So if I can get a dll to work then my life would be easier
Thanks bukken will try that tonight and post issues. I know I can get things to compile but no movement. Thanks tim
ATTENTION:
please realize a secure load & call logic (dynamic add/load) for different assembly's between 32bit and 64bit Ninja Systems !!!
...Currently you make/use only a "undocumented" single plattform version
I am so lost right now. So my form is in the dll. It opens and everything is fine. How do i acces the numeric indicator that is in the form. I can add a new one to the form but i cant seem to access the one thats in the form. What am i doing wrong here
So When I creat a new form NewForm timmybformm1 this is creating a new copy of that form, do i have to add all the code in the visual studio file? I am confused as to why i can add normal visual studio controls and they work fine.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
[Description("Enter the description of your new custom indicator here")]
public class Testingdll : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
TimmybForm1 NewForm = new TimmybForm1();
private Dundas.Gauges.WinControl.GaugeContainer gaugeContainer1;
protected override void OnStartUp()
{
Dundas.Gauges.WinControl.NumericIndicator numericIndicator1 = new Dundas.Gauges.WinControl.NumericIndicator();
Dundas.Gauges.WinControl.InputValue inputValue1 = new Dundas.Gauges.WinControl.InputValue();
this.gaugeContainer1 = new Dundas.Gauges.WinControl.GaugeContainer();
((System.ComponentModel.ISupportInitialize)(this.gaugeContainer1)).BeginInit();
//this.SuspendLayout();
NewForm.Controls.Add(this.gaugeContainer1);
this.gaugeContainer1.NumericIndicators.Add(numericIndicator1);
numericIndicator1.Value = 3456;
NewForm.Show();
}
protected override void Initialize()
{
}
protected override void OnTermination()
{
NewForm.Dispose();
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
}
#region Properties
#endregion
}
}
#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private Testingdll[] cacheTestingdll = null;
private static Testingdll checkTestingdll = new Testingdll();
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Testingdll Testingdll()
{
return Testingdll(Input);
}
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Testingdll Testingdll(Data.IDataSeries input)
{
if (cacheTestingdll != null)
for (int idx = 0; idx < cacheTestingdll.Length; idx++)
if (cacheTestingdll[idx].EqualsInput(input))
return cacheTestingdll[idx];
lock (checkTestingdll)
{
if (cacheTestingdll != null)
for (int idx = 0; idx < cacheTestingdll.Length; idx++)
if (cacheTestingdll[idx].EqualsInput(input))
return cacheTestingdll[idx];
Testingdll indicator = new Testingdll();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
Indicators.Add(indicator);
indicator.SetUp();
Testingdll[] tmp = new Testingdll[cacheTestingdll == null ? 1 : cacheTestingdll.Length + 1];
if (cacheTestingdll != null)
cacheTestingdll.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheTestingdll = tmp;
return indicator;
}
}
}
}
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.Testingdll Testingdll()
{
return _indicator.Testingdll(Input);
}
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.Testingdll Testingdll(Data.IDataSeries input)
{
return _indicator.Testingdll(input);
}
}
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.Testingdll Testingdll()
{
return _indicator.Testingdll(Input);
}
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.Testingdll Testingdll(Data.IDataSeries input)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
return _indicator.Testingdll(input);
}
}
}
#endregion
and this window. But it adds a new Digital display instead of just changing the number of the one thats there, I am really confused i know it iwll be obvious when i get it, i dont get why in visual studio or when i jsut copy and paste the entire code i just set the indicator1.value