Please add my vote as well
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Disable popup messages for rejected orders changes
Collapse
X
-
Hi all, I started programming some strategies on ninjatrader and i'm seriously flabbergasted that i have to stumble upon an issue that already exists since 2007 on this platform (based on the starting date of the thread ).
"Deciding on features for future releases is not a simple black and white decision. There are many factors involved including but not limited to:- Demand which is measured by objective user requests and subjective discretion on the part of our Product Management team.
- Feasibility
- Developer bandwidth
- Current projects in the queue
- Economics"
Imo, this argumentation for not implementing this feature is ridiculous. This feature, if you can already call it a feature, is just adding a simple boolean property at the setDefaults and checking it when the software wants to trigger a popup from a strategy. This isn't rocket science, and 5 minutes of work for a junior developer or an intern.
if (State == State.SetDefaults)
{
this.IsUnmanaged = true;
this.DisablePopupWindows = true;
}
For your legal concerns, you can add a popup at the startup of a strategy in which the user should consent and is aware the strategy will not popup any messages.
On top of that, all information and messages can already be found in the log...
For everybody who is interested, here is a snippet to kill those messages from code, just call the static "searchAndKill()"
namespace NinjaTrader.Custom.Strategies.PBRStrategy.OrderMan ager
{
using NinjaTrader.NinjaScript.Strategies;
using System.Runtime.InteropServices;
using HWND = System.IntPtr;
public static class OpenWindowGetter
{
public static IDictionary<HWND, string> GetOpenWindows()
{
HWND shellWindow = GetShellWindow();
Dictionary<HWND, string> windows = new Dictionary<HWND, string>();
EnumWindows(delegate (HWND hWnd, int lParam)
{
if (hWnd == shellWindow) return true;
if (!IsWindowVisible(hWnd)) return true;
int length = GetWindowTextLength(hWnd);
if (length == 0) return true;
StringBuilder builder = new StringBuilder(length);
GetWindowText(hWnd, builder, length + 1);
windows[hWnd] = builder.ToString();
return true;
}, 0);
return windows;
}
private delegate bool EnumWindowsProc(HWND hWnd, int lParam);
[DllImport("USER32.DLL")]
private static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam);
[DllImport("USER32.DLL")]
private static extern int GetWindowText(HWND hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("USER32.DLL")]
private static extern int GetWindowTextLength(HWND hWnd);
[DllImport("USER32.DLL")]
private static extern bool IsWindowVisible(HWND hWnd);
[DllImport("USER32.DLL")]
private static extern IntPtr GetShellWindow();
}
public class WindowKiller
{
[DllImport("user32.dll")]
public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;
public static void SearchAndKill()
{
foreach (KeyValuePair<IntPtr, string> window in OpenWindowGetter.GetOpenWindows())
{
IntPtr handle = window.Key;
string title = window.Value;
if (title.Contains("Error"))
{
SendMessage(handle.ToInt32(), WM_SYSCOMMAND, SC_CLOSE, 0);
}
}
}
}
}
- Likes 2
Comment
-
I agree, it is absolutely ridiculous that this issue of unwanted error popups has not been addressed!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
21 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
30 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
||
Started by catinabag, 04-13-2023, 05:46 AM
|
34 responses
1,460 views
0 likes
|
Last Post
by mcosta72
Today, 04:44 PM
|
||
Started by adeelshahzad, Today, 11:49 AM
|
6 responses
23 views
0 likes
|
Last Post
by mcosta72
Today, 04:35 PM
|
||
Started by sidlercom80, 05-05-2020, 07:20 AM
|
4 responses
304 views
0 likes
|
Last Post
by Bidder
Today, 04:35 PM
|
Comment