Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
error alert boxes
Collapse
X
-
Hello franatas,
Thank you for your post.
You can use try/catch blocks to trap exceptions.
Please see the example script below:
Within try/catch block, you can use Log() to write a message to the Log with notification window with LogLevel.Alert:
Or an alert:
Please see this Help Guide page on Alert and Debug concepts:
If you have any further questions, please let us know.
-
if ((cantidadSeleccionada1 > 0 && profit1 == 0) || (cantidadSeleccionada2 > 0 && profit2 == 0) || (cantidadSeleccionada3 > 0 && profit3 == 0) || (cantidadSeleccionada4 > 0 && profit4 == 0) || stop == 0)
{
NinjaTrader.NinjaScript.Alert.AlertCallback(NinjaT rader.Cbi.Instrument.GetInstrument("MSFT"), this, "replicador", NinjaTrader.Core.Globals.Now, Priority.Medium, "Replicador Compruebe los Profit y Stop",
NinjaTrader.Core.Globals.InstallDir + @"\sounds\Alert1.wav", new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0);
Application.Current.Dispatcher.InvokeAsync(new Action(() => {
NinjaTrader.Gui.Tools.NTMessageBoxSimple.Show(Wind ow.GetWindow(ChartControl.OwnerChart as DependencyObject), "Message Body", "Message Header", MessageBoxButton.OK, MessageBoxImage.None);
}));
ejecutarordenes = false;
ComprasButton.IsEnabled = true;
VentasButton.IsEnabled = true;
}
Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido
Error CS0120 Se requiere una referencia de objeto para el campo, método o propiedad 'ChartControl.OwnerChart' no estáticos NinjaTrader.Custom C:\Users\Franatas\Documents\NinjaTrader 8\bin\Custom\AddOns\FranatasReplicador21V3.cs 1473 Activo
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
656 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
577 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment