NexusFi: Find Your Edge


Home Menu

 





additional references dll


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one timmyb with 20 posts (8 thanks)
    2. looks_two bukkan with 5 posts (5 thanks)
    3. looks_3 tarantino with 3 posts (1 thanks)
    4. looks_4 Big Mike with 2 posts (3 thanks)
      Best Posters
    1. looks_one Big Mike with 1.5 thanks per post
    2. looks_two bukkan with 1 thanks per post
    3. looks_3 timmyb with 0.4 thanks per post
    4. looks_4 tarantino with 0.3 thanks per post
    1. trending_up 15,117 views
    2. thumb_up 17 thanks given
    3. group 5 followers
    1. forum 34 posts
    2. attach_file 10 attachments




 
Search this Thread

additional references dll

  #21 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


timmyb View Post
Ok so this one is probably for bukken.

So i managed to figure out how to build a form in visual basic then have ninja load it. Now here is my loading code.

TestForm.Show();

which loads the form

now that form has a button. But i cannot seem to gain access to the button I am curious how.

to make it simple i was trying to jsut have when i click the button a message box opens. But i am unsure how to get the ninja .cs to know if the button was clicked in the form in the dll

Hope this makes sense

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.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
  #22 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361

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.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #23 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361


here is the code in the dll, I open the form in ninja with

TimmybForm1 NewForm = new TimmybForm1(); // under variables
then onstartup i put

NewForm.show();

this makes the form open fine, and if i add toher things like text boxes ect i can populate them fine

I cant seem to set the line here

numericIndicator1.Value = 367.12;

i have tried everything and am so frusterated


 
Code
namespace Ninja_form_test_dll
{
    partial class TimmybForm1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            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();
            // 
            // gaugeContainer1
            // 
            this.gaugeContainer1.BackFrame.BackColor = System.Drawing.Color.DimGray;
            this.gaugeContainer1.BackFrame.BackGradientEndColor = System.Drawing.Color.White;
            this.gaugeContainer1.BackFrame.BackGradientType = Dundas.Gauges.WinControl.GradientType.HorizontalCenter;
            this.gaugeContainer1.BackFrame.BorderColor = System.Drawing.Color.DimGray;
            this.gaugeContainer1.BackFrame.BorderWidth = 2;
            this.gaugeContainer1.BackFrame.FrameShape = Dundas.Gauges.WinControl.BackFrameShape.Rectangular;
            this.gaugeContainer1.BackFrame.FrameStyle = Dundas.Gauges.WinControl.BackFrameStyle.Simple;
            this.gaugeContainer1.BackFrame.FrameWidth = 0F;
            this.gaugeContainer1.InternalBackgroundPaint = false;
            this.gaugeContainer1.Location = new System.Drawing.Point(29, 219);
            this.gaugeContainer1.Name = "gaugeContainer1";
            numericIndicator1.BackColor = System.Drawing.Color.Transparent;
            numericIndicator1.BackGradientType = Dundas.Gauges.WinControl.GradientType.None;
            numericIndicator1.BorderWidth = 0;
            numericIndicator1.IndicatorStyle = Dundas.Gauges.WinControl.NumericIndicatorStyle.Digital14Segment;
            numericIndicator1.LedDimColor = System.Drawing.Color.Empty;
            numericIndicator1.Location.X = 0F;
            numericIndicator1.Location.Y = 0F;
            numericIndicator1.Name = "Indicator1";
            numericIndicator1.Parent = "";
            numericIndicator1.ShowDecimalPoint = true;
            numericIndicator1.Size.Height = 99F;
            numericIndicator1.Size.Width = 99F;
            numericIndicator1.Value = 367.12;
            this.gaugeContainer1.NumericIndicators.Add(numericIndicator1);
            this.gaugeContainer1.Size = new System.Drawing.Size(327, 55);
            this.gaugeContainer1.TabIndex = 0;
            inputValue1.Name = "Default";
            this.gaugeContainer1.Values.Add(inputValue1);
            // 
            // TimmybForm1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(379, 477);
            this.Controls.Add(this.gaugeContainer1);
            this.Name = "TimmybForm1";
            this.Text = "TimmybForm1";
            ((System.ComponentModel.ISupportInitialize)(this.gaugeContainer1)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private Dundas.Gauges.WinControl.GaugeContainer gaugeContainer1;


    }
}

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #24 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

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:
 
Code
numericIndicator1.Value = 367.12M;
cheers..

Reply With Quote
  #25 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,353


bukkan View Post
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:
 
Code
numericIndicator1.Value = 367.12M;
cheers..

@bukkan

Haven't seen you in a while, hope all is well with you!

Regards,
TMFT

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
  #26 (permalink)
 futuretrader 
Como Italy
 
Experience: Intermediate
Platform: Ninjatrader, customized
Trading: ES
Posts: 525 since Feb 2010
Thanks Given: 471
Thanks Received: 643

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

Reply With Quote
  #27 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361


futuretrader View Post
@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

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #28 (permalink)
 TimeTrade 
Erfurt Germany
 
Experience: Master
Platform: rtMagic, NinjaTrader
Broker: AMP/CQG, IAB
Trading: ES, 6E, FDAX, FGBL
Posts: 338 since Aug 2011
Thanks Given: 54
Thanks Received: 461


timmyb View Post
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

Reply With Quote
  #29 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361

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.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #30 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361


so with this code i get this

 
Code
// 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

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on May 3, 2012


© 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