• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

First Add On

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NinjaTrader_ZacharyG
    replied
    Hello dotnet,

    Here's an example of how you can create a new Separator that has the same style of NT8's menu separators:

    Code:
    private Separator theSeparator;
    
    theSeparator = new Separator { Style = Application.Current.TryFindResource("MainMenuSeparator") as Style };

    Leave a comment:


  • dotnet
    replied
    adding menu separator - how to apply NT theme on controls

    How to apply default NT theme on the controls?
    For example

    Separator separator = new Separator();

    existingMenuItem.Items.Add(separator);

    add a windows shell style separator, and not the NT theme style.

    Thanks,
    dotnet

    Leave a comment:


  • NinjaTrader_ZacharyG
    replied
    Hello,

    We currently do not have any plans to implement .NET 4.6 as of yet.

    Leave a comment:


  • gregid
    replied
    Originally posted by dalebru View Post
    if (askLabel != null)
    {
    askLabel.Content = marketData.Ask?.Price;
    }
    I believe, you could even shorten it further to:
    Code:
     
    askLabel?.Content = marketData.Ask?.Price;
    Anyway +1 for the upgrade

    My feeling is that this single feature (null conditional) will be used most extensively in NinjaScript and if it won't be upgraded to .NET 4.6 before final release it won't be upgraded at all because of fear of users' scripts compatibility issues between 4.5 and 4.6. I may be wrong - just a feeling.
    Last edited by gregid; 03-03-2016, 07:55 AM.

    Leave a comment:


  • dalebru
    replied
    Originally posted by NinjaTrader_ZacharyG View Post
    Hello stephensams,

    I have tested the Sample Addon on my end and was able to reproduce that run-time error.

    To correct this, add a null check within the marketData_Update() method within the SampleAddonWindowTabPage for marketData.Ask and marketData.Bid:
    Code:
    // This event handler is called when new market data happens, the following statements are used to update the user interface. 
            private void marketData_Update(object sender, MarketDataEventArgs e)
            {
    	            if (askLabel != null && marketData.Ask != null)
    	            {
    	                askLabel.Content = marketData.Ask.Price;
    	            }
    	            if (bidLabel != null && marketData.Bid != null)
    	            {
    	                bidLabel.Content = marketData.Bid.Price;
    	            }
    	            if (askVolLabel != null && marketData.Ask != null)
    	            {
    	                askVolLabel.Content = marketData.Ask.Volume;
    	            }
    	            if (bidVolLabel != null && marketData.Bid != null)
    	            {
    	                bidVolLabel.Content = marketData.Bid.Volume;
    	            }
            }
    Thanks for this.
    The syntax gets a bit nicer with C# 6.0, and there are a lot of other C# 6.0 niceties I'm missing now. What are prospects for your supporting it? Thanks.

    e.g.
    if (askLabel != null)
    {
    askLabel.Content = marketData.Ask?.Price;
    }

    Leave a comment:


  • NinjaTrader_ZacharyG
    replied
    Hello stephensams,

    I have tested the Sample Addon on my end and was able to reproduce that run-time error.

    To correct this, add a null check within the marketData_Update() method within the SampleAddonWindowTabPage for marketData.Ask and marketData.Bid:
    Code:
    // This event handler is called when new market data happens, the following statements are used to update the user interface. 
            private void marketData_Update(object sender, MarketDataEventArgs e)
            {
    	            if (askLabel != null && marketData.Ask != null)
    	            {
    	                askLabel.Content = marketData.Ask.Price;
    	            }
    	            if (bidLabel != null && marketData.Bid != null)
    	            {
    	                bidLabel.Content = marketData.Bid.Price;
    	            }
    	            if (askVolLabel != null && marketData.Ask != null)
    	            {
    	                askVolLabel.Content = marketData.Ask.Volume;
    	            }
    	            if (bidVolLabel != null && marketData.Bid != null)
    	            {
    	                bidVolLabel.Content = marketData.Bid.Volume;
    	            }
            }

    Leave a comment:


  • stephensams
    replied
    With no edits to any of the sampleAddon files (4 add ons, one XAML), I got this log error...still getting it:

    Error in realtime market data handling: System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.NinjaScript.AddOns.SampleAddonWindowTa bPage.marketData_Update(Object sender, MarketDataEventArgs e)
    at NinjaTrader.Data.MarketData.OnMarketData(Object sender, MarketDataEventArgs e)
    at NinjaTrader.Cbi.Instrument.<>c__DisplayClass180_0. <OnRealtimeDataTimerElapsed>b__1(SubscribedThrea d[] threads, Int32 i, RealtimeEvents evts)


    Any advice?

    Leave a comment:


  • NinjaTrader_ZacharyG
    replied
    Hello stephensams,

    The changes should be made after a compile.

    Please verify that no errors appear in the Log tab of the Control Center. Additionally, check for any output in the New -> NinjaScript Output Window.

    Additionally, verify that your XAML syntax is correct. Revert back to a previously working XAML as well and test as well.

    Leave a comment:


  • stephensams
    replied
    If I edit the XAML, what do I need to do to refresh the interface? I've tried reopening the add-on, reconnecting NT, restarting NT, logging back in to windows, restarting windows, making sure the XMAL file is saved and closed. I also tried hitting F5 in the addon, but I'm not sure that would do anything. Thanks...BTW, I've renamed the XMAL file, as well as the calling reference in the addon.

    Leave a comment:


  • NinjaTrader_ZacharyG
    replied
    Hello palinuro,

    Thank you for writing in.

    Can you please provide your modified script demonstrating this issue so I may test on my end?

    Leave a comment:


  • palinuro
    replied
    I've been using the SampleAddon provided as a basis in post #8 of this thread, and have run into a problem with threading i don't understand.

    Using the "marketData_Update" method as provided in the example to update the label content works fine. But if I try to update label content in the "SelectedAccount_ExecutionUpdate" method (again provided in the example) I get a threading error.

    Ideally I'd like to update labels from that method, as well as a separate timer method (which I haven't tried yet).

    This probably reflects my lack of knowledge of multi-threading, but can you say why I'm getting this error, and point me in the right direction to fix it?

    Thanks.

    Leave a comment:


  • NinjaTrader_Matthew
    replied
    We had some design requirements to develop our own file loading dialog, and anticipated some feedback in this area to indicate there should be some improvements. We'll be reviewing this feature in the near future - SFT-41

    Leave a comment:


  • NJA_MC
    replied
    Originally posted by -=Edge=- View Post
    Also just noticed, and not sure if it's been brought up before.. Starting to loose track of everything I've read.. But would be nice to be able to select a directory tree from the top of the import form, vs to have to manually add the path and/or go thru the hoops of all the clicking..

    I haven't seen it yet but meant to bring it up as well. The file selector dialog box could use some work. It is a pain to move to a different Drive & Path to find the file of interest. Is there still a "FileDialog()" box that can be called from the system level? A quick check on MS website shows that was a WinForm dialog. Here is a C# version, not sure if it has the same feel of it NT8 is already using it:
    http://www.c-sharpcorner.com/uploadf...dialog-in-wpf/
    http://stackoverflow.com/questions/3...pf-application

    This seems to be a problem for most WPF applications... Most people recommend using the older FORMs version.

    Leave a comment:


  • -=Edge=-
    replied
    Also just noticed, and not sure if it's been brought up before.. Starting to loose track of everything I've read.. But would be nice to be able to select a directory tree from the top of the import form, vs to have to manually add the path and/or go thru the hoops of all the clicking..

    Leave a comment:


  • -=Edge=-
    replied
    Originally posted by NinjaTrader_Matthew View Post
    Thanks for the report, we'll have that fixed - NTEIGHT-8213

    I'm attaching a sample addon made by NinjaTrader_Jesse which has some more thorough inline comments which may assist with creating a custom window and implemented the tab features, etc.

    Please expect updates to our AddOn documentation in the next few weeks.
    Thanks..


    Edit.. Previous comment I believe was user error..

    Last edited by -=Edge=-; 05-12-2015, 05:01 PM.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by GLFX005, Today, 05:48 AM
0 responses
1 view
0 likes
Last Post GLFX005
by GLFX005
 
Started by bacentheng, Today, 01:49 AM
1 response
6 views
0 likes
Last Post GLFX005
by GLFX005
 
Started by ttodua, Today, 02:51 AM
0 responses
2 views
0 likes
Last Post ttodua
by ttodua
 
Started by TSmith, Today, 01:40 AM
0 responses
7 views
0 likes
Last Post TSmith
by TSmith
 
Started by ypbtrainer, Yesterday, 05:38 PM
2 responses
8 views
0 likes
Last Post ypbtrainer  
Working...
X