Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Other required NTTabPage members left out for demonstration purposes

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

  • NinjaTrader_ChelseaB
    replied
    Hello Omololu,

    After some searching I found an example of a combox box with binding you may find helpful.
    https://ninjatrader.com/support/foru...85#post1045985

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Omololu,

    I am not aware of any publicly available addons that use a combo box. This would fall under general C# and WPF.

    I can provide an example that adds a menu.
    https://ninjatrader.com/support/foru...07#post1124507

    Below is a publicly available link to the 3rd party educational site DotNetPerls with an example.
    https://www.dotnetperls.com/combobox-wpf

    Below is a public link to a google search of 'system.windows.controls.combobox example'.
    https://www.google.com/search?safe=a...mbobox+example
    Last edited by NinjaTrader_ChelseaB; 10-28-2020, 09:40 AM.

    Leave a comment:


  • omololu
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello Omololu,

    Likely you will need to add a combobox (or ntmenu) which you can populate with values.

    Then you can compare the selected value of the combobox to an enum value (.ToString()) to see if the user has selected that value.
    Thanks Chelsea for your reply.

    Please, could you direct me to example scripts/codes to add combobox/ntmenu ?

    Regards.

    Omololu

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Omololu,

    Likely you will need to add a combobox (or ntmenu) which you can populate with values.

    Then you can compare the selected value of the combobox to an enum value (.ToString()) to see if the user has selected that value.

    It may be possible to use binding to bind the combobox to an enum, but that would be getting outside of what the NinjaTrader Support team supports.
    https://stackoverflow.com/questions/...n-wpf/28173189

    Leave a comment:


  • omololu
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello omololu,

    The example I have provided you was to address your inquiry. This example uses StartAtmStrategy without an NTTabPage in a custom addon window to demonstrate an NTTabPage is not required to use StartAtmStrategy.

    The error: 'Object reference not set to an instance of an object' means a variable with a null value was used.

    What is the variable with null object?

    (You can use prints to find out)

    if (myAccount == null)
    {
    Print("myAccount is null);
    }
    Hi Chelsea,

    I've made a good progress in my ChartTrader indicator project ... THANKS for your tips and guides.

    In the course of going through your tips and guide, I got introduced to the SubmitOrderWithAtmAddonNoTabsExample Addon, and which looks very interesting. I will want to tweak the Addon to include ORDER ACTION (Buy and Sell) and ORDER TYPE (Market, Limit and StopLimit) and as shown in my attached screenshot. Please, is this feasible ? If Yes, could you please give me some tips and guides again.

    Regards.

    Omololu

    Click image for larger version

Name:	Submit Order With ATM.png
Views:	55
Size:	14.0 KB
ID:	1125033

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello omololu,

    The example I have provided you was to address your inquiry. This example uses StartAtmStrategy without an NTTabPage in a custom addon window to demonstrate an NTTabPage is not required to use StartAtmStrategy.

    The error: 'Object reference not set to an instance of an object' means a variable with a null value was used.

    What is the variable with null object?

    (You can use prints to find out)

    if (myAccount == null)
    {
    Print("myAccount is null);
    }

    Leave a comment:


  • omololu
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello Omololu,

    That would not be correct. An NTTabPage is not required to use StartAtmStrategy(). I will make a note to have this documentation changed to note implementing a TabControl is optional.

    A TabControl implements tabs in a custom window. An NTTabPage is the content of a tab.

    Attached is the SubmitOrderWithAtmAddonExample_NT8, found with the link below, created without a TabControl.
    https://ninjatrader.com/support/foru...486#post794486

    Also, below is a link to examples of addons with and without a TabControl.
    http://ninjatrader.com/support/forum...059#post477059
    Hi Chelsea,

    Thanks for the tips and guides. The "SubmitOrderWithAtmAddonNoTabsExample" seems to be on a different path from my path. It is very interesting and I may explore that path in the nearest future. At lease, I learnt how ATM strategy is submitted.

    Meanwhile I'm still not succeeding in my project to trigger an ATM from my indicator and to do order entries (Market, Limit, StopLimit, etc). This is what I have;

    #region Using declarations
    .
    .
    .
    using NinjaTrader.Gui.NinjaScript.AtmStrategy;
    #endregion

    namespace NinjaTrader.NinjaScript.Indicators
    {
    public class myChartTraderIndicator : Indicator
    {
    .
    .
    .
    private NinjaTrader.Gui.NinjaScript.AtmStrategy.AtmStrateg ySelector atmStrategySelector;
    private NinjaTrader.Gui.Tools.AccountSelector accountSelector;
    private NinjaTrader.Gui.Tools.InstrumentSelector instrumentSelector;
    .
    private void OnMyBuyMarketButtonClick(object sender, RoutedEventArgs rea)

    {

    .
    .
    .
    entryOrder = myAccount.CreateOrder(myInstrument, OrderAction.Buy, OrderType.Market, OrderEntry.Manual, TimeInForce.Gtc, 3, 0, 0, "", "entryOrder", Core.Globals.MaxDate, null);
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(atmStrategySelector.SelectedAtmStrategy, entryOrder);
    myAccount.Submit(new[] { entryOrder });


    Please note that I have defined "myAccount" and "myInstrument" correctly and as required. In any case, the indicator successfully compiled but when my order is submitted with a button click, I received the following log error;

    "Unhandled exception: Object reference not set to an instance of an object."

    I observed that when I remove the "NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(atmStrategySelector.SelectedAtmStrategy, entryOrder)" script, the order got successfully submitted.

    Please, what am I still doing wrongly.

    Regards.

    Omololu

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Omololu,

    That would not be correct. An NTTabPage is not required to use StartAtmStrategy(). I will make a note to have this documentation changed to note implementing a TabControl is optional.

    A TabControl implements tabs in a custom window. An NTTabPage is the content of a tab.

    Attached is the SubmitOrderWithAtmAddonExample_NT8, found with the link below, created without a TabControl.
    https://ninjatrader.com/support/foru...486#post794486

    Also, below is a link to examples of addons with and without a TabControl.
    http://ninjatrader.com/support/forum...059#post477059
    Attached Files
    Last edited by NinjaTrader_ChelseaB; 10-25-2020, 04:30 PM.

    Leave a comment:


  • Other required NTTabPage members left out for demonstration purposes

    I need to trigger an already created ATM named "xyz21" in my indicator that I use to do order entries (Market, Limit, StopLimit, etc). The indicator is 90% satisfactory. In the course of searching this forum for solutions, I ran into the topic of this my new thread that says "Other required NTTabPage members left out for demonstration purposes. Be sure to add them in your own code. (see a typical link here)". Please, what/where are these NTTabPage members ? It seems that I need the NTTabPage scripts to enable my indicator use my ATM. Please note that my interest is in using an indicator NOT a strategy for my order entries. I shall appreciate any help.

    Regards.

    Omololu

Latest Posts

Collapse

Topics Statistics Last Post
Started by StockJock, Today, 08:52 PM
0 responses
2 views
0 likes
Last Post StockJock  
Started by rmicalet, Today, 07:10 PM
0 responses
4 views
0 likes
Last Post rmicalet  
Started by cincai, Today, 07:02 PM
0 responses
2 views
0 likes
Last Post cincai
by cincai
 
Started by AlexsOptions, Today, 05:42 PM
2 responses
18 views
0 likes
Last Post AlexsOptions  
Started by philli4093, Today, 05:20 PM
2 responses
8 views
0 likes
Last Post philli4093  
Working...
X