private void OnChartMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (!waitingForClick) return; try { ChartControl chartControl = sender as ChartControl; if (chartControl == null) return; // Obtener la posición del clic en la gráfica Point mousePosition = e.GetPosition(chartControl); double chartY = mousePosition.Y; // Convertir la posición del clic en un precio double price = chartControl.ChartPanel.GetValueByY(chartY); // Configurar el precio del stop stopPrice = price; // Crear una orden Buy Stop Limit en el precio seleccionado SubmitBuyStopOrder(1, stopPrice); Print("Orden Buy Stop creada en el precio: " + stopPrice); // Desactivar la espera de clic waitingForClick = false; // Desuscribirse del evento para evitar clics posteriores ChartControl.MouseDown -= OnChartMouseDown; } catch (Exception exc) { Print("Error al procesar el clic en la gráfica: " + exc.Message); } }
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
click on the graph and place a buystop on that price
Collapse
X
-
click on the graph and place a buystop on that price
I am programming a button in the charttrader, that when it is active, the user can click on the graph and place a buystop on that price
Code:Last edited by leojimenezp; 09-02-2024, 07:30 AM.Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
54 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
25 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
17 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
23 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
24 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment