Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

click on the graph and place a buystop on that price​

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

    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:
    
    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); } }​
    Last edited by leojimenezp; 09-02-2024, 07:30 AM.

    #2
    Hello leojimenezp,

    Thank you for your post.

    I'm not seeing a question being asked regarding this topic - do you have a question to ask regarding how to do this?

    There is a sample script demonstrating how to place orders by clicking the mouse.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    54 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X