Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Other required NTTabPage members left out for demonstration purposes
Collapse
X
-
Hello Omololu,
After some searching I found an example of a combox box with binding you may find helpful.
- Likes 1
-
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.
Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've
Below is a publicly available link to the 3rd party educational site DotNetPerls with an example.
Below is a public link to a google search of 'system.windows.controls.combobox example'.
https://www.google.com/search?safe=a...mbobox+exampleLast edited by NinjaTrader_ChelseaB; 10-28-2020, 10:40 AM.
Leave a comment:
-
Originally posted by NinjaTrader_ChelseaB View PostHello 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.
Please, could you direct me to example scripts/codes to add combobox/ntmenu ?
Regards.
Omololu
Leave a comment:
-
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.
Leave a comment:
-
Originally posted by NinjaTrader_ChelseaB View PostHello 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);
}
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
Leave a comment:
-
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:
-
Originally posted by NinjaTrader_ChelseaB View PostHello 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
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:
-
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#post477059Last edited by NinjaTrader_ChelseaB; 10-25-2020, 05: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.
OmololuTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by helpwanted, Today, 03:06 AM
|
0 responses
3 views
0 likes
|
Last Post
by helpwanted
Today, 03:06 AM
|
||
Started by Brevo, Today, 01:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
242 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
Leave a comment: